Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MENU_COLOR = Color(160,163,161,255) -- Color for the AFK checker
- TEXT_COLOR = Color(0,0,0,225) -- Color for Text
- net.Receive( "timerstart", function( ply )
- print( "Message received from server!")
- DPanel = vgui.Create( "DPanel" )
- DPanel:SetSize(350, 200)
- DPanel:Center()
- DPanel:SetBackgroundColor( MENU_COLOR )
- DPanel:SetVisible( false )
- DLabel = vgui.Create( "DLabel", DPanel )
- DLabel:SetPos( 10, 5 )
- DLabel:SetText( "AFK Timer" )
- DLabel:SetColor( TEXT_COLOR )
- DLabel:SetFont("Trebuchet24")
- DLabel:SizeToContents()
- AFKTEXT1 = vgui.Create( "DLabel", DPanel )
- AFKTEXT1:SetPos( 10, 30 )
- AFKTEXT1:SetText( "You still here?" )
- AFKTEXT1:SetColor( TEXT_COLOR )
- AFKTEXT1:SetFont("Trebuchet18")
- AFKTEXT1:SizeToContents()
- AFKTEXT2 = vgui.Create( "DLabel", DPanel )
- AFKTEXT2:SetPos( 10, 45 )
- AFKTEXT2:SetText( "Please click the okay button to show you are here." )
- AFKTEXT2:SetColor( TEXT_COLOR )
- AFKTEXT2:SetFont("Trebuchet18")
- AFKTEXT2:SizeToContents()
- button = vgui.Create( "DButton", DPanel)
- button:SetPos(math.random(10, 200),math.random(55, 100))
- button:SetSize(50,50)
- button:SetText("Okay")
- button.DoClick = function()
- DPanel:Remove()
- end
- end)
- SERVER ================================
- hook.Add("PlayerConnect","afkcheck", function(ply)
- print("This hook works ya dingus")
- timer.Simple( 5, function()
- print("This timer works ya dingus")
- net.Start("timerstart")
- net.Send(ply)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement