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)
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.