I am trying to make it so that when you click the button it adds 1 to the label every click.
The most I've gotten is so that it adds 1 and then just sits there. Any help is appreciated!
local Button = vgui.Create( "DButton", Frame )
Button:SetText( "Click" )
Button:SetSize( 250,75 )
Button:SetPos( 35 , 35 )
Button.Paint = function( self , w , h )
draw.RoundedBox( 4 , 0 , 0 , w , h , Color( 255 , 0 , 255 , 255 ))
end
Button.DoClick = function()
clicks = clicks + 1
Label:SetText( tostring(clicks) )
end
Sorry, you need to Log In to post a reply to this thread.