Don't Hide GUIS on Death

I’m currently creating a obby game but when I die the gui disappears. I’ve already tried disabling ResetOnDeath and cloning the script that enables the gui when the player dies.

Is there any way to delete all the create assets and rerun all the scripts?

3 Likes

Please provide more information. If you have a custom setup that gives players a gui, you have to share this script or a part of it.

GUIs automatically get cloned to the player gui upon death if ResetOnDeath is not enabled and that GUI is parented to StarterGui, and GUIs are not destroyed upon death when enabled. So there is another factor involved here.

1 Like

Most of the script is just making certain elements visible. I have tried using ResetOnDeath.
An example:
ChatBar.Visible = true
This is where chat bar is defined:
local ChatBar = script.Parent:WaitForChild(“ChatBar”)

1 Like

How do your GUIs get cloned to the player gui? Do you place them in StarterGui or do you have a script that does it?

Where is this script located?

2 Likes

The script parents the GUI. The script is inside of StarterGui already.

You would have to detect when the player dies and run the script again.

local Players = game:GetService("Players") --get players service
local Player = Players.LocalPlayer --get the local player(client)
local PlayerGui = Player:WaitForChild("PlayerGui") --get their gui container

Player.CharacterAdded:Connect(function() --listen for the character added event
	local ScreenGui = PlayerGui:WaitForChild("Name of Your Gui")
	-- code to make guis visible
end)

This essentially does the job, just fill in the gaps.

1 Like

I decided to make it clone the gui over on death, thanks for your help.