Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do I fix this? attempt to index number with 'Character'

Asked by 4 years ago

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)
0
Can I get more context on this? rabbi99 714 — 4y
0
We need to know what is plrs. Rheines 661 — 4y

Answer this question