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

How do I make a GUI not appear when you respawn?

I've been trying this script:

local Gui = script.Parent -- The parent of the script is the gui
Gui:Destroy()

3 answers

If it's a one time GUI you'd want to clone it in when a player first joins a server. Since they can only join once they'll get the GUI once every time they join.

Put the GUI in ReplicatedStorage and make a script in ServerScriptService to do:

game.Players.PlayerAdded:Connect(function(plr)
	local gui = game.ReplicatedStorage.GUI_NAME:Clone()
	gui.Parent = plr.PlayerGui
end)

Here's an answer. As posted by an answer above, all ScreenGuis have an option in the properties tab called "ResetOnSpawn" where if the player dies, and the ResetOnSpawn option is checked, the Gui stays. So an easy fix would be this:

local Gui = script.Parent

Gui.ResetOnSpawn = false

Hope this helps!

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