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

Why wont this GUI stay on the screen when the player dies?

Asked by 8 years ago

So I am making a GUI where if the player forgets to pick their team in the menu then they have a little GUI on the bottom right of the screen to tell them to change their team. However if the player resets their character, the GUI goes. How can I make this GUI stay until they pick their team?

while wait() do
if player.TeamColor == BrickColor.new("Lily white")then
script.Parent.Parent.Parent.Parent.ForgetGUI.Frame.Visible = true
end
end

INFO: This is a LocalScript.

0
I'm summing the script and the gui are both locaqted in starter gui. koolkid8099 705 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

There is a specific setting under StarterGui that can change the behavior of resetting the GUI on reset:

ResetPlayerGuiOnSpawn

This can be found in the properties of StarterGui as seen here: http://imgur.com/Z1EjZ3j

This value, which is set by default when a place is created, sets if the players GUI should be deleted when the player dies/resets/respawns. In this case, I think that your GUI gets cleared when the player resets the character, which causes the team change GUI to disappear. Try setting this to false, and see what happens!

Roblox Wiki page: http://wiki.roblox.com/index.php?title=API:Class/StarterGui/ResetPlayerGuiOnSpawn

After setting this, make sure that none of your scripts depend on the resetting of the GUI on death. Setting this may cause problems with these kinds of scripts.

This may or may not be what the problem is in this particular case, since this problem can be cause by other things. However, it is definitely something you should try.

0
Thanks so much! BennyBoiOriginal 293 — 8y
Ad

Answer this question