Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Bleh()
- local buttons = {}
- local Frame = vgui.Create( "DFrame" )
- Frame:SetPos( 5, 5 )
- Frame:SetSize( 300, 300 )
- Frame:SetTitle( "Admin Stuff" )
- Frame:SetVisible( true )
- Frame:SetDraggable( false )
- Frame:ShowCloseButton( true )
- Frame:MakePopup()
- local Button = vgui.Create( "DButton", Frame )
- Button:SetText( "Return Me" )
- Button:SetTextColor( Color( 255, 255, 255 ) )
- Button:SetPos( 50, 50 )
- Button:SetSize( 100, 30 )
- Button.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue button
- end
- Button.DoClick = function()
- RunConsoleCommand("ulx", "return")
- end
- table.insert(buttons, Button)
- local Button2 = vgui.Create( "DButton", Frame )
- Button2:SetText( "Enable Godmode" )
- Button2:SetTextColor( Color( 255, 255, 255 ) )
- Button2:SetPos( 90, 90 )
- Button2:SetSize( 100, 30 )
- Button2.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue button
- end
- Button2.DoClick = function()
- RunConsoleCommand("ulx", "god")
- end
- table.insert(buttons, Button2)
- for k, v in pairs(buttons) do
- local click = v.DoClick
- v.DoClick = function(self)
- click()
- self.Drag = true
- end
- end
- Frame.Think = function()
- local x, y = input.GetCursorPos()
- for k, v in pairs(buttons) do
- if v.Drag then
- v:SetPos(x, y)
- end
- end
- end
- Frame.OnMousePressed = function(self, key)
- if not (key == MOUSE_LEFT) then return end
- for k, v in pairs(buttons) do
- if v.Drag then v.Drag = false end
- end
- end
- end
- concommand.Add("bleh", Bleh)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement