Ex: when you die a frame gui stays on your screen for 5 seconds
Thats an example dont do. do it only if you want to .-.
You will want to use the .Enabled property of frames.
Put a frame in a ScreenGui and put a localscript inside the frame. Then, you can use the Humanoid.Died event to check when you died.
local frame = script.Parent game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function() frame.Enabled = true wait(5) frame.Enabled = false end)
However, if the player respawns within 5 seconds, the character's startguis will be destroyed and new ones will be cloned. There are ways to circumvent this such as disabling Player.CharacterAutoLoads and showing the screen for 5 seconds, and then manually respawning them yourself.
If you want to make a death screen, then here's how you do it.
Make your death gui
Set Enabled to false on the gui
Set ResetOnSpawn to true on the gui
Then add the following script to the gui:
repeat wait() until game.Players.LocalPlayer.Character char = game.Players.LocalPlayer.Character local humanoid = char:WaitForChild("Humanoid") humanoid.Died:Connect(function() script.Parent.Enabled = true end)
Make sure the script is directly in the gui
Hope this works!