Guest User

Untitled

a guest
May 16th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. include( 'shared.lua' )
  2.  
  3.  
  4.  
  5. function ShowTeamMenu()
  6.  
  7. local XPos = (surface.ScreenWidth() / 2) - 250
  8. local YPos = (surface.ScreenHeight() / 2) - 100
  9. local DermaPanel = vgui.Create( "DFrame" )
  10. DermaPanel:SetPos( XPos,YPos )
  11. DermaPanel:SetSize( 500,250 )
  12. DermaPanel:SetTitle( "Choose Your Team, Maggot" ) // Name of Fram
  13. DermaPanel:SetVisible( true )
  14. DermaPanel:SetDraggable( true ) //Can the player drag the frame /True/False
  15. DermaPanel:ShowCloseButton( false ) //Show the X (Close button) /True/False
  16. DermaPanel:MakePopup()
  17.  
  18. local DBTeam1 = vgui.Create( "DButton" )
  19. DBTeam1:SetParent( DermaPanel ) // Set parent to our "DermaPanel"
  20. DBTeam1:SetText( "Team 1" )
  21. DBTeam1:SetPos( 25, 50 )
  22. DBTeam1:SetSize( 150, 50 )
  23. DBTeam1.DoClick = function ()
  24. RunConsoleCommand("team_1")
  25. LocalPlayer():ChatPrint("You are now on Team 1")
  26. DermaPanel:SetVisible(false)
  27. end
  28.  
  29.  
  30. local DBTeam2 = vgui.Create( "DButton" )
  31. DBTeam2:SetParent( DermaPanel ) // Set parent to our "DermaPanel"
  32. DBTeam2:SetText( "Team 2" )
  33. DBTeam2:SetPos( 325, 50 )
  34. DBTeam2:SetSize( 150, 50 )
  35. DBTeam2.DoClick = function ()
  36. RunConsoleCommand( "kill" ) // What happens when you press the button
  37. end
  38.  
  39. local DBTeam3 = vgui.Create( "DButton" )
  40. DBTeam3:SetParent( DermaPanel ) // Set parent to our "DermaPanel"
  41. DBTeam3:SetText( "Team 3" )
  42. DBTeam3:SetPos( 25, 150 )
  43. DBTeam3:SetSize( 150, 50 )
  44. DBTeam3.DoClick = function ()
  45. RunConsoleCommand( "kill" ) // What happens when you press the button
  46. end
  47.  
  48. local DBTeam4 = vgui.Create( "DButton" )
  49. DBTeam4:SetParent( DermaPanel ) // Set parent to our "DermaPanel"
  50. DBTeam4:SetText( "Team 4" )
  51. DBTeam4:SetPos( 325, 150 )
  52. DBTeam4:SetSize( 150, 50 )
  53. DBTeam4.DoClick = function ()
  54. RunConsoleCommand( "kill" ) // What happens when you press the button
  55. end
  56. end
  57.  
  58. usermessage.Hook( "call_vgui", ShowTeamMenu )
Add Comment
Please, Sign In to add comment