Death respawn countdown not working?

i’m trying to make a death screen that shows a message and a countdown to when the player will respawn. the message randomizer works, but for some reason, the message text stays as the placeholder and not starting the countdown. i have tried printing the loop, but that didn’t work either

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local frame = script.Parent
local messageText = frame.Message
local timer = frame.Respawning

local deathMessages = {
	'skill issue ☠',
	'have you considered living?',
	'never eating at chum bucket again',
	'ERR_PLR_HEALTH_NILL',
	"womp womp, let's go clearance for clearnce",
	'go back to fortnite lil fella',
	'"Imagine dying" -George Washington, probably',
}

local function getRandomMessage()
	return deathMessages[math.random(#deathMessages)];
end

humanoid.Died:Connect(function()
	frame.Visible = true
	messageText.Text = getRandomMessage()
	
	for i = 8,0 -1 do
		timer.Text = "RESPAWNING IN ("..i..")"
		task.wait(1)
	end
end)
1 Like

Are there any errors in the output?

3 Likes

nope, and when I tried printing it there was no output

3 Likes

Do you mind sending a screenshot of the UI in the explorer?

1 Like

image

1 Like

I think your problem is here. Replace it with this:
for i = 8, 0, -1 do
(Note the second comma).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.