So I have my own deathscreen that plays whenever a player dies, but for some reason the deathscreen only pops ups most the time, but sometimes it randomly doesn’t pop up, I have no idea what causes this random bug, here is the script:
wait()
local players = game.Players
local t = 2
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
local gui = player.PlayerGui:FindFirstChild("DeathScreen")
humanoid.Died:Connect(function(died)
player.PlayerGui:FindFirstChild("DeathScreen"):WaitForChild("ImageLabel").Visible = true
local f = game.TweenService:Create(player.PlayerGui:FindFirstChild("DeathScreen"):WaitForChild("ImageLabel"), TweenInfo.new(0.6, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {["ImageTransparency"] = 0.1})
f:Play()
wait(1.3)
local e = game.TweenService:Create(player.PlayerGui:FindFirstChild("DeathScreen"):WaitForChild("ImageLabel"), TweenInfo.new(1.2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {["ImageTransparency"] = 1})
e:Play()
for i = t, 0, -1 do
player.PlayerGui:FindFirstChild("DeathScreen").ImageLabel.Timer.Text = " "..i
wait(1)
end
player.PlayerGui:FindFirstChild("DeathScreen").ImageLabel.Timer.Text = " 3"
player.PlayerGui:FindFirstChild("DeathScreen"):WaitForChild("ImageLabel").Visible = false
local e = game.TweenService:Create(player.PlayerGui:FindFirstChild("DeathScreen"):WaitForChild("ImageLabel"), TweenInfo.new(0.7, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {["ImageTransparency"] = 1})
e:Play()
end)
end)
end)