I used the code below to try and do the same thing for all the players in my game but it always says "attempt to index number with 'Character" and the script won't run from there. I started scripting a couple weeks ago and don't know every thing... anyone who knows this please help.

for x, player2 in pairs(plrs) do
	if player2 then
		character = player2.Character
		
		if character then
			-- Teleport them to the chosen map
			character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame + Vector3.new(0,7,0)
			table.remove(AvailableSpawnPoints,1)

2 comments

0

Can I get more context on this?

0

We need to know what is plrs.