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

Humanoid MoveToPoint math.random Not working?

So I have a test dummy, and I want to to move around randomly.

I put this script into the Humanoid, but It comes with an error:

X cannot be assigned to

This is the script

while true do
local Humanoid = script.Parent
Humanoid.WalkToPoint.X = Vector3.new(math.random(100,100))
Humanoid.WalkToPoint.Z = Vector3.new(math.random(100,100))
wait (math.random(1,5))
end

1 comment

0

I don't think you can change the x,y, or the z by itself, but I'll make sure.

2 answers

If you go on the wiki and scroll down to the properties, it says that x, y, and z are read only, meaning that you can't change them

2 comments

0

So is there any way to change them?

0

You can change the whole thing at once, if you're not sure how to I can show you.

-- Local script --
-- Put this script into your StarterGui
wait()
game.Players.LocalPlayer.Character.Humanoid:MoveTo(Vector3.new(-100,100))

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