Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Loading Gui Not Removing From The Players Gui After You Reset?

Asked by 9 years ago

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


0
Use PlayerAdded to add the Gui to the player's PlayerGui, so that it loads one time only. aquathorn321 858 — 9y
0
oh ok thanks, i wish i had of thought to do that :P zangdragonoid 0 — 9y
0
wow, now the gui scroll thing is not moving! zangdragonoid 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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)
0
thanks but the scroll isnt moving across zangdragonoid 0 — 9y
Ad

Answer this question