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

How can I make it so when a player dies the welcome gui doesnt show again?

Asked by 10 years ago

I wish I had the script at the moment sorry I dont.

1 answer

Log in to vote
0
Answered by
Defaultio 160
10 years ago

One way to do this is to store a value somewhere that you can use to remember if this if the first time the player has spawned. Your best bet for where to put this value might be the Player. That's because it's easy to find there, and the descendants of the Player object don't reset every time the player dies, as happens for the player's character or PlayerGui. Also, when the Player leaves, the value will be removed because the Player object is removed. If you put the value elsewhere, like somewhere in Workspace or ReplicatedStorage, you would have a stackup of values over time as the game runs. Also, you'd have to find a way to differentiate which value belongs to which player.

I would do this by having a local script in my welcome gui that checks if there is a value called, let's say AlreadySpawned, under game.Players.LocalPlayer. If not, the script knows that this is the first time the player spawned, and the script allows the welcome gui to display. It creates a value called AlreadySpawned and parents it to the Player, so that the next time around the script will catch this value and remove the gui.

Ad

Answer this question