You can use NWVars.
self:SetNWBool( "cooling", true ) serverside will allow you to call self:GetNWBool( "cooling" ) clientside and retrieve the value.
Or you can use DTVars
Thanks BL00DB4TH.
Whats DTVars for future reference KingofBeast?
I'm fairly sure that DTVars update with usermessages only when needed, an advantage over NWVars.
I haven't ever really messed with them, but they seem to be simple. I believe that the engine automatically calls ent:SetupDataTables() when an ent is created so you would need to give that function, it's shared so both client and server need it, and it would look something like this
[lua]
function ENT:SetupDataTables()
self:DTVar("Int",0,"price")
self:DTVar("Entity",1,"owning_ent")
end
[/lua]
And then you can do things like ent:SetDTInt("price", 9001) or ent:GetDTInt("price")
It seems that I can't get the Boolean to work, I make the Boolean turns a message that makes the printer's 2d3d say "Cooled," but when the Boolean is off is makes the printer's 2d3d say that the printer Isn't Being Cooled. I can't get this to work, can someone print me out an example code?
Please don't use NWVars, this is one of the main problems that cause Reliable Snapshot Overflow, use usermessages or very small DTVars.
Sorry, you need to Log In to post a reply to this thread.