- Initiateur de la discussion
Taho
Geek
- Messages
- 17
- Score réaction
- 3
- Points
- 80
Bonsoir, je suis débutant en lua et je souhaiterais savoir comment faire en sorte que dès que mon bouton soit cliqué ça mettrai directement la personne dans la team que je souhaite.. voici mon code :
Code:
local Base = vgui.Create( "DFrame" ) Base:SetSize( 500, 295 ) Base:Center() Base:SetTitle("") Base:MakePopup() Base:ShowCloseButton( false ) function Base:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 44, 62, 80 ) ) draw.SimpleText( "EnosiaRôleplay", "Trebuchet24", w / 2, 10, color_white, 1 ) end local btnClose = vgui.Create( "DButton", Base ) btnClose:SetSize( 32, 32 ) btnClose:SetPos( Base:GetWide() - btnClose:GetWide() - 5, 40 / 2 - btnClose:GetTall() / 2 ) btnClose:SetText( "X" ) btnClose:SetTextColor( color_white ) btnClose.Paint = nil function btnClose:DoClick() Base:Remove() end local DermaButton = vgui.Create( "DButton", Base ) DermaButton:SetText( "Démissioner" ) DermaButton:SetPos( 25, 80 ) DermaButton:SetSize( 450, 80 ) DermaButton:SetTextColor( color_white ) function DermaButton:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 150 ) )
end DermaButton.DoClick = function() RunConsoleCommand( "say", "/test" )
end local DermaButton1 = vgui.Create( "DButton", Base ) DermaButton1:SetText( "Fermer" ) DermaButton1:SetPos( 25, 170 ) DermaButton1:SetSize( 450, 80 ) DermaButton1:SetTextColor( color_white ) function DermaButton1:Paint( w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 150 ) )
end DermaButton1.DoClick = function() Base:Remove()
end