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

Im trying to make a loading page but it wont remove after 10 seconds, Any ideas why?

I made my loading page but when I play it and wait for the 10 seconds to go, it plays the audio its suppost to play after the time but it wont remove the GUI, if I remove the wait time the GUI doesn't load but if I put a timer it doesn't want to delete. I have tried Destroy and Transparency=1 but none want to work. This is what I have currently got

function PlayerEntered() wait(10) game.Workspace.Intro:Destroy game.Workspace.IntroClosed:Play() end

game.Players.PlayerAdded:connect(onPlayerEntered) onPlayerEntered(game.Players:WaitForChild("Player1")) --this must be here to test it in studio

6 comments

1

Wth is that script?

1

Like, about 99% of it is wrong

0

Add "()" after your Destroy, like that :Destroy()

0

Won't help him, this script is 0% FE, and FE is quite neccesary for a game

0

;-;

0

try game.Debris:AddItem() instead, its much more efficient than :Destroy()

1 answer

Okkay, your script make no sense. But i can help you to arrange this.

Firstly, when you call the Event "PlayerAdded" the Event tell you who is the player. So in your script game.Players.PlayerAdded:connect(onPlayerEntered) onPlayerEntered(game.Players:WaitForChild("Player1")) is wrong. The correctly version is game.Players.PlayerAdded:Connect(onPlayerEntered)

Secondly, a player can not view a ScreenGui unless than this is in PlayerGui. So for this, your GUI must be in StarterGui.

Now, in your function we should see this

function PlayerEntered(Player)
      wait(10)
      Player.PlayerGui:WaitForChild('Intro'):Destroy() -- Please close your instance to work.
      game.Workspace.IntroClosed:Play()
end

So if you have questions you can ask me them. Sorry for my errors in my text i speak french

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