i have turned off the rest on respawn command but its still not deleting the Gui when the player dies or rests. Plz help me ?
Hello, Ash_Gold!
You could use the Humanoid.Died function to tell when a player has died. When they do die you can go and disable the script.
local Player = game.Players.LocalPlayer local PlayerGui = Player:WaitForChild("PlayerGui") local Character = workspace:WaitForChild(Player.Name) local Humanoid = Character.Humanoid or Character:WaitForChild("Humanoid") local ScreenGuiName = "ScreenGui" Humanoid.Died:Connect(function() PlayerGui:WaitForChild(ScreenGuiName).Enabled = false end)