How to make death screen when the player dies!
Click here to download the model!
1) Make a new ScreenGui inside StarterGui | game.StarterGui
2) Set IgnoreGuilnset to true (inside the ScreenGui we made)
It will make the GUI on all of our screen
3) Make a frame and design it
Set the size to: 1,0,1,0 and design it however you want
4) Make a TextLabel and name it "Timer"
5) Design it however you want
6) Make a new LocalScript inside the ScreenGui
7) Set the frame to invisible
8) Script it
local players = game:GetService("Players")
local localplayer = players.LocalPlayer
local char = localplayer.Character
local hum = char:WaitForChild("Humanoid")
local Frame = localplayer.PlayerGui:WaitForChild("DeathScreen"):FindFirstChild("DeathFrame") -- Make the "YourScreenGuiNameHere" to your ScreenGui name and the "YourFrameNameHere" to your Frame name
local Timer = Frame:WaitForChild("Timer")
hum.Died:Connect(function() -- Detects when the player dies
Frame.Visible = true -- Sets the Frame visible to true when the player dies
for i = 5,0, -1 do -- Pairs loop countdown from 5 to 0
wait(1)
Timer.Text = "You will respawn in "..i -- Changing the text to the time that the player will respawn in
if i == 0 then -- Checks if the countdown got to 0
Frame.Visible = not Frame.Visible -- Sets the frame invisible
end
end
end)
9) Make sure to set the RespawnTime to the time you did in the timer
And you’re done!
Thanks for reading! - If you need any help feel free to reply