Trying to teleport player when timer ends

I’m trying to teleport the player to another place when the timer ends, everything is working fine except when it reaches 0 the player isn’t teleporting, what could be my issue?

local intermission = 5

local status = game.ReplicatedStorage.Status

local plrs = game:GetService("Players")
local ts = game:GetService("TeleportService")

local placeids = {
	"16270689227"
}

local placeID = placeids[math.random(#placeids)]

status.Changed:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if status.Value == 0 then
		ts:Teleport(placeID, player)
	end
end)

local function roundTeleport()
		for i = intermission, 0, -1 do
			status.Value = "Game will start in "..i.." seconds"
			wait(1)
		end
end

spawn(roundTeleport)

Are you removing time from the timer?

What do you mean by removing time from the timer?

I see you have some sort of value which is probably a number of which the game checks if 0 then teleports. I don’t see any sort of code that lowers this timer though.

Would it work if I made the status value equal to intermission?

That could work if you lowered the inter mission. You can also just make the value of status lower at whatever interval you want.

I just realized status was a string value

Well there’s no where visible in the script lowering the value even if it was a number value.

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