• Derma (text only) not working, or is it the hook?
    1 replies, posted
What I want to do is make text be displayed at all times unless a value is true. This is my code: Derma for text: [lua]function StartARndGUI() local blah = vgui.Create("DLabel", myParent) blah:SetPos(ScrW() / 2, ScrH() / 2) blah:SetColor(Color(255,255,255,255)) blah:SetFont("default") blah:SetText("Press E to start a round") blah:SizeToContents() end[/lua] To check if variable: [lua]function rndcheck() if (!isPlaying) then StartAHeistGUI() end end hook.Add( "Think", "bleheheheh", StartARndGUI )[/lua] isPlaying is in shared.lua as isPlaying = false Nothing works though. It doesn't display the text, no errors even.
[code] //server util.AddNetworkString( "StartFunction" ) function StartWhatEver() net.Start( "StartFunction" ) net.send() end [/code] [code] //client net.Receive( "StartFunction", function( len ) StartPlaying = true timer.Simple( Timeyouwanttodostuff, function() blah:SetVisible( false ) end ) if ( !blah ) then blah = vgui.Create("DLabel", myParent) blah:SetPos(ScrW() / 2, ScrH() / 2) blah:SetColor(Color(255,255,255,255)) blah:SetFont("default") blah:SetText("Press E to start a round") blah:SizeToContents() else blah:SetVisible( true ) end end) [/code] i'm at college right now and i i din't get too much sleep so.. you need to double or even triple check it... But yeah, send when you want it to start, and then open your panel. I made a timer for it to close by it self but you can make another send or a thing for that on the client. hope it helped!
Sorry, you need to Log In to post a reply to this thread.