Discord
Steam
/
Garry's Mod
/
Developers
/
Display server..
Login/Join
Event Log
Display serverside variables on clientside
4 replies, posted
Search
In This Thread
I have this DLabel and I want the text to be self.propane, self.propane is a variable in the serverside file. How would I make it work?
Network this variable with SetGlobalInt, SetNW* or just network this once with net messages
I have this: [lua] self.propane = 100 SetGlobalInt( "propane", self.propane ) [/lua] and this in clientside: [lua] local labelP = vgui.Create("DLabel") labelP:SetParent( mainFrame ) labelP:SetSize( 150, 15 ) labelP:SetPos( 400, 240 ) labelP:SetText( "Propane: " ..propane ) labelP:SetFont( "nFont1" ) [/lua] But it says it's a nil value.
What's a nil value, and is it on the serverside or the clientside? Also where is the serverside located, is it inside an entity?
Use SetNWInt if you are using entities.
Sorry, you need to
Log In
to post a reply to this thread.