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

MoveTo is broken or something?Your title should be specific! Describe your problem concisely.

Asked by 6 years ago

f9 says MoveTo is not a valid member or Part when I test

local spawnPos = script.Parent local pos = spawnPos

while wait(30) do -- Spawn Delay local noob1 = game.ServerStorage.Noobs.Noob:clone() noob1.Parent = game.Workspace noob1:MoveTo(pos.Position + Vector3.new(0,1,0))

end

I thought it was on my part but a few days later when I took some free model tool that spawns models in game, it gave that MoveTo error.

bin = script.Parent

function onButton1Down(mouse)

local model = bin.Marble:clone()

model.Parent = game.Workspace
model:MakeJoints()
model:MoveTo(mouse.hit.p)

end

function onSelected(mouse) mouse.Icon = "rbxasset://textures\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end

bin.Selected:connect(onSelected)

0
Sweet title, I hate that! FlippinAwesomeCrew 62 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

MoveTo is not a valid member of Part because MoveTo has to be used on a Humanoid. Parts do not have this function. I hope this helped!

i.e:

local model = bin.Marble:clone()
local humanoid = Instance.new("Humanoid")
humanoid.Parent = model

model.Parent = game.Workspace
model:MakeJoints()
humanoid:MoveTo(mouse.hit.p)

0
Thanks! yodaxvader 0 — 6y
0
No problem! starwars5251977 48 — 6y
Ad

Answer this question