Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. local donations = {
  2.  
  3.     {
  4.  
  5.         name = "V.I.P Rank"
  6.  
  7.     }
  8.  
  9. }
  10.  
  11. local dpanel = vgui.Create( "DPanel" )
  12. dpanel:SetPos( 0, 0 )
  13. dpanel:SetSize( 100, 100 )
  14.  
  15. local dpanelscroll = vgui.Create( "DScrollPanel", dpanel )
  16. dpanelscroll:SetPos( 0, 0 )
  17. dpanelscroll:SetSize( dpanel:GetWide(), dpanel:GetTall() )
  18.  
  19. for k, v in pairs( donations ) do
  20.     local button = vgui.Create( "DButton", dpanelscroll )
  21.     button:SetPos( 0, 55 * (k-1) )
  22.     button:SetSize( dpanelscroll:GetWide(), 50 )
  23.     button.Paint = function(s,w,h)
  24.         draw.DrawText( donations[k].name, "Font", 5, h / 2 - 2, Color( 255, 255, 255 ), TEXT_ALIGN_CENTER )
  25.     end
  26.     button.DoClick = function()
  27.         if donations[k].name == "V.I.P Rank" then
  28.             if IsValid(info) then
  29.                 info:Remove()
  30.             end
  31.  
  32.             local info = vgui.Create( "DPanel" )
  33.         end
  34.     end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement