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 3 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 — 3y
0
Thanks! TheEggsquidzidBoi 38 — 3y

Answer this question