• Set something to be called later
    4 replies, posted
This is what i want to do. [lua] function sleep(ply) if ply:GETwhatiwant( "whatiset" ) then -- The game else -- Profit ply:SETwhatiwant( "whatiset", true ) end end [/lua] I think i saw this somewhere before, but I'm not sure. basically i want to set a condition that is set elsewhere. Any thoughts?
[lua] function CheckStatus( pl ) local bool = pl:GetNetworkedBool( "Status" ) if bool == true then print( "His status checks out." ) else print( "Invalid status!" ) end end[/lua] Networked bools/integers?
Indeed. However, is there a way i could use such a system for more practical and simple uses? say this: [lua] function lemon( pl ) haseaten=0 If haseaten=1 then print( "yuck!" ) else print( "Delicious lemon!" ) set haseaten 1 end end [/lua] i don't know, i think I'm just going round in circles. what would be the best way to achieve that lemon script?
[lua]function CheckLemons( pl ) local lemon = pl:GetNWInt( "Lemon" ) if lemon > 0 then print( "Yuck!" ) else print( "Mmmm, a lemon..." ) pl:SetNWInt( "Lemon", 1 ) end end[/lua] You can set networked variables as easily as you can get them.
Your a great help Entros, Thanks a bunch.
Sorry, you need to Log In to post a reply to this thread.