Making Gui after reset

soo. i found problem like if i will reset, gui wont create again. im creating gui by local script. What ways are exist to recreate gui after death?

gui = Instance.new("ScreenGui")
gui.ResetOnSpawn = true
gui.Name = "NewGuiYay"
gui.Parent = game.Players.LocalPlayer.PlayerGui

You might want to set it to false, if it’s true, then the Gui would reset, or in this case, it gets destroyed.

If you put it in a startercharacterscript it may recreate again.

Alternatively if that doesn’t work for you you could connect a humanoid.Died function.