Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. ocal binds = {}
  2.  
  3. net.Receive("Binder", function()
  4. local Frame = vgui.Create( "DFrame" )
  5. Frame:SetTitle( "Bind Maker" )
  6. Frame:SetSize( 300, 300 )
  7. Frame:Center()
  8. Frame:MakePopup()
  9. Frame.Paint = function( self, w, h )
  10. draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 100, 20, 150 ) )
  11. end
  12.  
  13. local form = vgui.Create( "DTextEntry", Frame )
  14. form:SetSize( 100, 50 )
  15. form:SetPos( 25, 35 )
  16. local Button = vgui.Create("DButton", Frame)
  17. Button:SetText( "Click here to bind" )
  18. Button:SetTextColor( Color(0, 20, 50) )
  19. Button:SetPos( 100, 100 )
  20. Button:SetSize( 100, 30 )
  21. Button.Paint = function( self, w, h )
  22. draw.RoundedBox(0, 0, 0, w, h, Color(41, 128, 185, 250) ) -- Draw a blue button
  23. end
  24. Button.DoClick = function()
  25. binds[ binder:GetSelectedNumber() ] = form:GetText()
  26. end
  27. // Position this how you like
  28.  
  29. local binder = vgui.Create( "DBinder", Frame )
  30. binder:SetSize( 200, 50 )
  31. binder:SetPos( 25, 100 )
  32.  
  33.  
  34. binds[ num ] = form:GetText()
  35. end
  36. end)
  37.  
  38. hook.Add( "Think", "BindChecks", function()
  39. for k,v in pairs( binds ) do
  40. if input.IsKeyDown( k ) then
  41. RunConsoleCommand( "say", "/advert " .. v )
  42. end
  43. end
  44. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement