so im creating a player detection system to check who's still alive
i insert a boolean value into each player
problem is it's not adding them to the table or something because the round ends because it doesn't find anything in my active players table ;(
here's my relevant code
for _, plyr in pairs(playerTable) do
local char = plyr.Character
local torso = char:WaitForChild("Torso")
local activetag = Instance.new("BoolValue")
activetag.Parent = char
activetag.Name = "activetag"
local spawnto = spawntable[math.random(1,#spawntable)]
torso.CFrame = CFrame.new(spawnto.Position)
spawnto:remove()
wait()
end
sTag.Value = "ingame"
aTag.Value = "Game in progress"
while timetag.Value > 0 do
wait(1)
timetag.Value = timetag.Value - 1
local activeplayers = {}
for _, player in pairs(game.Players:GetPlayers()) do
local char = player.Character
local activetag = char:findFirstChild("activetag")
if activetag then
table.insert(activeplayers, player)
end
print(#activeplayers)
if #activeplayers <= 0 then --if the number of active players is less than or equal to a certain number, then end the round.
break
end
end
end
aTag.Value = "The round is over."
wait(3)
wait()
end

1 comment
that has nothing to do with what i was asking and no, it wasn't a mistake. the teleportation system works just fine thank you. anyway, i fixed the issue.