Advertisement
Guest User

Untitled

a guest
May 24th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. MENU_COLOR = Color(160,163,161,255) -- Color for the AFK checker
  2. TEXT_COLOR = Color(0,0,0,225) -- Color for Text
  3.  
  4.  
  5. net.Receive( "timerstart", function( ply )
  6.     print( "Message received from server!")
  7.     DPanel = vgui.Create( "DPanel" )
  8.     DPanel:SetSize(350, 200)
  9.     DPanel:Center()
  10.     DPanel:SetBackgroundColor( MENU_COLOR )
  11.     DPanel:SetVisible( false )
  12.  
  13.     DLabel = vgui.Create( "DLabel", DPanel )
  14.     DLabel:SetPos( 10, 5 )
  15.     DLabel:SetText( "AFK Timer" )
  16.     DLabel:SetColor( TEXT_COLOR )
  17.     DLabel:SetFont("Trebuchet24")
  18.     DLabel:SizeToContents()
  19.  
  20.     AFKTEXT1 = vgui.Create( "DLabel", DPanel )
  21.     AFKTEXT1:SetPos( 10, 30 )
  22.     AFKTEXT1:SetText( "You still here?" )
  23.     AFKTEXT1:SetColor( TEXT_COLOR )
  24.     AFKTEXT1:SetFont("Trebuchet18")
  25.     AFKTEXT1:SizeToContents()
  26.  
  27.     AFKTEXT2 = vgui.Create( "DLabel", DPanel )
  28.     AFKTEXT2:SetPos( 10, 45 )
  29.     AFKTEXT2:SetText( "Please click the okay button to show you are here." )
  30.     AFKTEXT2:SetColor( TEXT_COLOR )
  31.     AFKTEXT2:SetFont("Trebuchet18")
  32.     AFKTEXT2:SizeToContents()
  33.  
  34.     button = vgui.Create( "DButton", DPanel)
  35.     button:SetPos(math.random(10, 200),math.random(55, 100))
  36.     button:SetSize(50,50)
  37.     button:SetText("Okay")
  38.     button.DoClick = function()
  39.     DPanel:Remove()
  40.     end
  41. end)
  42.  
  43. SERVER ================================
  44.  
  45. hook.Add("PlayerConnect","afkcheck", function(ply)
  46.     print("This hook works ya dingus")
  47.     timer.Simple( 5, function()
  48.         print("This timer works ya dingus")
  49.         net.Start("timerstart")
  50.         net.Send(ply)
  51.     end)
  52. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement