I Have No Idea How To Fix This But When It Works And Destroys But When You Reset It Comes Back, How Can I Stop That From Happening?
for i = 0,100,1 do script.Parent.PercentLabel.Text = "Progress: " .. math.floor(i) .. "%" script.Parent.Scroll.Size = UDim2.new(0, i*4, 0, 40) script.Parent.Scroll.BackgroundColor3 = Color3.new(math.random(),math.random(),math.random()) wait(math.random(0.08,0.80)) if script.Parent.PercentLabel.Text == "Progress: 100%" then wait () script.Parent.Loading:Destroy() wait () script.Parent.PercentLabel.Text = "Assets Loaded..." wait (3) script.Parent:Destroy() end end
Hey, You need to put the GUI in PlayerGui object so it persists only until the player respawns...
Here is a sample code:
game.Players.ChildAdded:connect(function(player) local GUI = script.ScreenGui local PlayerUI = player:WaitForChild("PlayerGui") wait(1) GUI.Parent = PlayerUI end)