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

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

Asked by
Aqu_ia 39
5 years ago

I've been trying this script:

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

3 answers

Log in to vote
1
Answered by 5 years ago

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: lua game.Players.PlayerAdded:Connect(function(plr) local gui = game.ReplicatedStorage.GUI_NAME:Clone() gui.Parent = plr.PlayerGui end)

Ad
Log in to vote
0
Answered by 5 years ago

ScreenGui (and other instances which inherit from LayerCollector) have a property called ResetOnRespawn. Here's the Wiki page.

Log in to vote
0
Answered by 5 years ago

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!

Answer this question