Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. local function Bleh()
  2. local Frame = vgui.Create( "DFrame" )
  3. Frame:SetPos( 5, 5 )
  4. Frame:SetSize( 300, 300 )
  5. Frame:SetTitle( "Admin Stuff" )
  6. Frame:SetVisible( true )
  7. Frame:SetDraggable( false )
  8. Frame:ShowCloseButton( true )
  9. Frame:MakePopup()
  10.  
  11.  
  12. local Button = vgui.Create( "DButton", Frame )
  13. Button:SetText( "Return Me" )
  14. Button:SetTextColor( Color( 255, 255, 255 ) )
  15. Button:SetPos( 50, 50 )
  16. Button:SetSize( 100, 30 )
  17. Button.Paint = function( self, w, h )
  18. draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue button
  19. end
  20. Button.DoClick = function()
  21. RunConsoleCommand("ulx", "return")
  22. end
  23.  
  24. Button.Drag = false
  25.  
  26. Frame.OnMousePressed = function(self, key)
  27. if (key == MOUSE_LEFT) then
  28. Button.Drag = false
  29. end
  30. end
  31.  
  32. Button.DoClick = function(self)
  33. self.Drag = not self.Drag
  34. local x, y = self:GetPos()
  35. end
  36.  
  37. Button.Think = function(self)
  38. if (self.Drag) then
  39. local x, y = input.GetCursorPos()
  40. self:SetPos(x, y)
  41. end
  42. end
  43.  
  44. local Button = vgui.Create( "DButton", Frame )
  45. Button:SetText( "Enable Godmode" )
  46. Button:SetTextColor( Color( 255, 255, 255 ) )
  47. Button:SetPos( 90, 90 )
  48. Button:SetSize( 100, 30 )
  49. Button.Paint = function( self, w, h )
  50. draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue button
  51. end
  52. Button.DoClick = function()
  53. RunConsoleCommand("ulx", "god")
  54. end
  55. end
  56. concommand.Add("bleh", Bleh)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement