For some reason, when i was making this script. It decided to break & i found the bug, it’s super confusing and im still wondering why its doing this.
for i, plr in pairs(game.Players:GetChildren()) do
plr.Team = playingTeam- - the part where it actaully changes their team
if plr.Team == playingTeam then -- the part where it actaully breaks
print("test3")
table.insert(playing, plr.Name)
print(#playing)
else
print("not working")
end
could somebody help me? this bug would not allow me to contiune further with my development.
local playingTeam = {path}
for _, plr in pairs(game.Players:GetChildren()) do
plr.Team = playingTeam
if plr.Team == playingTeam then
print("test3")
table.insert(playing, plr.Name)
print(#playing)
else
print("not working")
end
end
print("test")
local playing = {}
print("test1")
for i, plr in pairs(game.Players:GetChildren()) do
print("test2")
if plr.Team == playingTeam then
print("test3")
table.insert(playing, plr.Name)
print(#playing)
else
print("not working")
end
end
if started.Value == true then
for i, plr in pairs(game.Players:GetChildren()) do
plr.Team = playingTeam
local character = plr.Character
local humanRoot = character:WaitForChild("HumanoidRootPart")
humanRoot.CFrame = game.Workspace.spawn.CFrame
character:WaitForChild("Humanoid").Died:Connect(function()
plr.Team = lobby
end)
end