DarkRP Printer Cooler Help

So I decided using DarkRP was the best way for me to learn Lua, it’s my third day and I’ve been experimenting with adding non-templated code to the lua and I’ve run into a snag with the printer cooling.

The Printer’s Init Lua: http://pastebin.com/753mzjyH
The Printer’s Cl_init Lua: http://pastebin.com/YXwDK5ca

Incase you’re wondering, I’m editing ©rzlar’s printer cooler.

Can anyone help me out here? dunno what to do.

[editline]3rd September 2012[/editline]

Sorry, forgot to mention my intentions.

The idea is that a Boolean or something goes off in the init.lua, when this boolean goes off a value in cl_init.lua turns on and sets a text to return to txt3 as “Cooling” or “Not Cooling.”

Thanks for any help.

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

function ENT:SetupDataTables()

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.