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

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

Asked by 6 years ago

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

1
Wth is that script? User#20388 0 — 6y
1
Like, about 99% of it is wrong User#20388 0 — 6y
0
Add "()" after your Destroy, like that :Destroy() NiniBlackJackQc 1562 — 6y
0
Won't help him, this script is 0% FE, and FE is quite neccesary for a game User#20388 0 — 6y
View all comments (2 more)
0
;-; bubyspp1 5 — 6y
0
try game.Debris:AddItem() instead, its much more efficient than :Destroy() Nikkulaos 229 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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

Ad

Answer this question