Error: Workspace.GameManager.Findwinner:6: attempt to concatenate nil with string
Code:
while true do wait() local alive = game.Teams.Survivors:GetPlayers() if script.Parent.PlayersLeft.Value == 1 then local name = alive.Name script.Parent.GameStatus.Value = name .. "won the game!" end end
You're getting a table, and trying to see the name of it.
while true do wait() local alive = game.Teams.Survivors:GetPlayers() if script.Parent.PlayersLeft.Value == 1 then local name = alive[1].Name script.Parent.GameStatus.Value = name .. "won the game!" end end
I'm pretty sure this is the solution.
I ended up just using a different strategy with for I, v in pairs technique. AND IT WORKED.
while true do wait() if script.Parent.PlayersLeft.Value == 1 then local teams = game:GetService('Teams') for _, player in pairs(teams['Survivors']:GetPlayers()) do print(player.Name) end end end