Hi! I've got a litle question because I'm new at this.. If I had f.e. this code :
[CODE]
hook.Add("KeyPress" , "blabla" , function(ply, key)
ply.something = true
end)[/CODE]
(KeyPress is a shared hook) How can i get the value of ply.something on a Tick hook (also a shared hook)?
[CODE]hook.Add("Tick", "asdasd", function()
--How to get ply.something here to work with it?
end)[/CODE]
Thanks for the help :)
Do something like:
Server Tick
[code]for k,ply in pairs( player.GetAll() ) do
local check = ply.something
--Rest of code
end [/code]
Client Tick
[code]local check = LocalPlayer().something
--Rest of code [/code]
Keep in mind that just because the hook is shared doesn't mean the variables are. If you set ply.something in the server hook it will NOT transcribe to the client one.
-snip- a bit too late
Both hooks are shared, aren they? (At least thats what gmod wiki says)
When i do a for loop so v becomes the player, v.something seems to be null :(
Sorry, you need to Log In to post a reply to this thread.