yes :
nclude('shared.lua')
net.Receive( "MyNpcFunction", function()
local frame = vgui.Create( "DFrame" ) -- Main Frame
frame:SetTitle("Title")
frame:SetSize( 800, 800 )
frame:Center()
frame:GetBackgroundBlur()
frame:MakePopup()
frame.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h, Color( 50, 50, 50, 150 ) )
end
function frame.OnClose() -- PROBLEM HERE
ProgressBar:SetFraction( 0 )
ProgressBar.Remove() -- Or Close but it doen't work too...
end
local ProgressBar = vgui.Create( "DProgress" ) -- Progress Bar
ProgressBar:SetPos( 600, 500 )
ProgressBar:SetSize( 400, 30 )
ProgressBar:SetFraction( 0 )
local i=0
local Button = vgui.Create( "DButton", frame ) -- Button
Button:SetText( "Progress Bar Start" )
Button:SetPos( 250, 500 )
Button:SetSize( 250, 30 )
function Button.DoClick()
print( "[DARKRP] Progress..." )
timer.Create( "TraitementBar", 0.3, 100, function()
i = i+0.01
ProgressBar:SetFraction( i )
end )
end
end )