I'm making a round system for a game and I made a game length variable to indicate when the time is up but right when it starts the game runs it even though there are 43 seconds left, Can anyone help me?
local gameLength = 43 for i = gameLength,0,-1 do for x, player in pairs(playersAlive) do if player then character = player.Character if not character then -- Left the game else if character:FindFirstChild("GameTag") then -- They are still alive else -- They are dead table.remove(playersAlive,x) print(player.Name.." Has been removed!") end end else table.remove(playersAlive,x) print(player.Name.." Has been removed!") end end if i == 0 then status.Value = "Times up!" wait(2) break end
player is not a valid statement. You need to define it. You could try adding, local player = game:GetService("Players")