Guest User

Untitled

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