GUI not working after death

So I made a menu that when you equip it a gui pops up and when you unequip it, it disappears. I found out that if you die, then respawn and try the menu it doesn’t work. Can you guys help me?
Here is my script:

local player = game.Players.LocalPlayer
local pgui = player:WaitForChild("PlayerGui")
local sgui = pgui:WaitForChild("Standard")
local frame = sgui:WaitForChild("ImageLabel")
local tool = script.Parent

tool.Equipped:Connect(function()
	frame.Visible = true
end)

tool.Unequipped:Connect(function()
	frame.Visible = false
end)

Thanks!

2 Likes

Is the ScreenGui property ResetOnSpawn enabled?
image

Also, are you using the same tool to access the menu which your character used before it respawned, or does it spawn with a new tool every time?

2 Likes

It is the same tool everytime.

You won’t spawn with a new one every time? Oh well, then see if setting ResetOnSpawn to false fixes it.

4 Likes

Yes it is at resetonspawn……………………

Try removing ResetOnRespawn if this script is never recreated