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

Attempt to index nil with MoveTo?

Asked by 4 years ago

Im trying to make only select players in an array teleport to a certain location in my code here:

local teleport = PlayersPlaying
        for index = 1, #teleport do 
            PlayersPlaying[index].Character:MoveTo(Vector3.new(176, 31.5, 635))
        end

but it says "Attempt to index nil with MoveTo".

If anyone can help I will greatly appreciate it!

0
:MoveTo() is pretty deprecated, instead you can set HumanoidRootPart's CFrame to a brick in that position OR use :SetPrimaryPartCFrame() on the player's model into that brick. User#32819 0 — 4y
0
Thanks! TheEggsquidzidBoi 38 — 4y

Answer this question