Teleporting all players on a team to a position

local team = game.Teams["team 1"]
		local plrsOnTeam = team:GetPlayers()
		wait(2)
		print(plrsOnTeam)
		plrsOnTeam.Character.HumanoidRootPart.Position = Vector3.new(89.6, 288.4, 392.5)

the error code says attempted to index nil with humaniodrootpart

2 Likes

Just loop through the plrsOnTeam table.

for i, v in pairs(plrsOnTeam) do
    v.Character.HumanoidRootPart.Position = Vector3.new(89.6, 288.4, 392.5)
end

or do v.Character:MoveTo(Vector3.new(89.6, 288.4, 392.5))

thank you!!!

what would i do if i wanted to teleport the other teams to a area like team a and team b team a wins and they go to the winning area and team b lost so they go to the losing area

local otherTeams = game.Teams