Categories > Coding > Lua >

How can i use hookfunction?

tar

CoolNickname

Posts: 142

Threads: 15

Joined: Jul, 2021

Reputation: 1

Posted

I cant find a good tutorial or anything that helps me understand how to use hookfunction. I want to hook OnClientEvent and cancel it if its have an unwanted argument.

  • 0

https://imgur.com/a/oOomuUo

hookfunction

fake wumat

vip

Posts: 145

Threads: 20

Joined: Aug, 2021

Reputation: 19

Replied

hookfunction basically 'switches' functions between them, example:

hookfunction(print, warn) -- first argument is what you want to switch and 2 nd argument is what u wanna switch it into
print("hello world!") -- this will WARN hello world!

you can also use arguments in hookfunctions like:

hookfunction(print, function(text) -- first argument is what u wanna switch, and 2nd one is what u wanna switch it into with the argument
warn("hooked: ", text)
end)
print("hello world!") -- this will WARN hooked: hello world!

i hope u understand lol

  • 0

                                                                        https://cdn.discordapp.com/attachments/909012795851407390/927492917394821140/siggy.png

yranxzy

joe22

vip

Posts: 552

Threads: 113

Joined: Aug, 2020

Reputation: 33

Replied

epic lua coder is here

 

hookfunction(print, warn)

 

print("fag)

 

 

EZZZ

  • 0

when the function got hennessey

tar

CoolNickname

Posts: 142

Threads: 15

Joined: Jul, 2021

Reputation: 1

Replied

@hookfunction thanks for ur help

  • 0

https://imgur.com/a/oOomuUo

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )