Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i fix this attempt to index field 'move' (a function value) error?

attempt to index field 'move' (a function value)

local pos = game.Workspace.move.Position
while true do 
	wait()
	script.Parent.Humanoid:MoveTo(pos)
end

1 answer

✓ Accepted answer

The MoveTo method needs to be invoked on a model, not a humanoid or anything else, so just go one level higher and use script.Parent

local pos = game.Workspace.move.Position
while true do 
    wait()
    script.Parent.Humanoid:MoveTo(pos)--humanoid isnt a model so it doesnt work
end

4 comments

0

wait so i have to move modle?

0

yup, isnt the entire robloxian what you wanted to move?, anyway here is the wiki for the moveto method, there is a useful argument inside it : https://www.robloxdev.com/api-reference/function/Model/MoveTo

0

yeah

0

Make sure to declare which is the primarypart by using this,model.PrimaryPart = (whatever part you want it to base the position on)

This discussion is preserved as it was. New answers, comments, and votes are closed.