Hello I'm trying to make a loading gui but when the frame has reached (1.0, 0, 1, 0) it doesn't stop and i can't fint out how to fix it please help me here is the script
local prog = script.Parent local gui = script.Parent.Parent.Parent.Parent.Parent local frame = script.Parent.Parent.Parent.Parent local lbarback = frame.LoadingBarBackground local text = lbarback.Text local textscript = lbarback.Text.Script wait(0.8) repeat prog.Size = prog.Size + UDim2.new(0.01, 0, 0, 0) wait(0.10) until prog.Size == UDim2.new(1.0, 0, 1, 0) while true do if prog.Size == UDim2.new(1.0, 0, 1, 0) then textscript.Disabled = true text.Text = "Loaded!!" wait(1.5) gui:Destroy() end wait(0.01) end
Here is a picture Link
Not too sure if this is the problem, but try this. I just made a few adjustments.
local prog = script.Parent local gui = script.Parent.Parent.Parent.Parent.Parent local frame = script.Parent.Parent.Parent.Parent local lbarback = frame.LoadingBarBackground local text = lbarback.Text local textscript = lbarback.Text.Script wait(0.8) repeat X1=prog.Size.X.Scale+.01 --Adds to the scale size prog.Size = UDim2.new(X1, 0, 1, 0) --Applies scale wait(0.10) until prog.Size.X.Scale >=1 if prog.Size.X.Scale>1 then prog.Size=UDim2.new(1,0,1,0) --Assures that it's not too big end while true do if prog.Size == UDim2.new(1, 0, 1, 0) then textscript.Disabled = true text.Text = "Loaded!!" wait(1.5) gui:Destroy() end wait(0.01) end
I think that this should work. If you have any further problems, please leave a comment below. Hope I helped :P