Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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


3 comments

0

Use PlayerAdded to add the Gui to the player's PlayerGui, so that it loads one time only.

0

oh ok thanks, i wish i had of thought to do that :P

0

wow, now the gui scroll thing is not moving!

1 answer

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)

1 comment

0

thanks but the scroll isnt moving across

This discussion is preserved as it was. New answers, comments, and votes are closed.