Code:
for _, player in game.Players do if (player.Team.Name == "Contestant" and player.Answer.Value ~= answer) then player.Team = game.Teams.Eliminated player:LoadCharacter() player.Answer.Value = "" end end
What the code is supposed to do is go through every player, check if they are on the Contestant team and got the answer wrong, and respawn them, change their team, and reset their answer value. The first line (for) is failing, saying that I tried calling an instance (or something close to that)
Do you know how to loop over the players ? Because this is not how you do it.
this is how you do it
local players = game:GetService("Players") for _, player in pairs(players:GetPlayers()) do if (player.Team.Name == "Contestant" and player.Answer.Value ~= answer) then player.Team = game.Teams.Eliminated player:LoadCharacter() player.Answer.Value = "" end end