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

Problem with random walk script ?

Asked by 8 years ago

Hello, I'm having a problem with a script I made: I made a script to move a character to a random position, but the problem is that the script seems to work on ROBLOX studio but when I play it online, the character moves, but it spins on itself. Here's first, a video showing the character online: https://www.youtube.com/watch?v=EP35LL0WC_o

Here's the script I use (the script is in the character's model) :

bin = script.Parent
h = bin.Jane
Torso = bin.Torso
base = game.Workspace.Base

wait(3.5)
while wait() do
h:MoveTo(Vector3.new(math.random(33,250),0,math.random(0,800)))
wait(2.5)
h:MoveTo(Vector3.new(Torso.Position.x, Torso.Position.y, Torso.Position.z), Torso)
wait(2.5)
end

One last thing: I also put a script inside the character that follows someone at a distance of 70 of him.

1 answer

Log in to vote
0
Answered by 8 years ago

I don't think the script you listed could be responsible for the behaviour you explained, since you mentioned you put in another script that also tells the character to try and move in a certain way. Perhaps they are conflicting? (Actually, there are syntax errors in this one, which might explain it -- it should be capital "X"/"Y"/"Z")

One thing to consider is to MoveTo a position that is close to the Torso, instead of using absolute coordinates. ex:

--Your script, lines 1-4, here
range = 20
wait(1)
while wait(2.5) do
h:MoveTo(Vector3.new(Torso.Position.X + math.random(-range, range), Torso.Position.Y, Torso.Position.Z + math.random(-range, range)), Torso)
end
0
Thank you for the answer. I tried puting this script but unfortunately, the problem persists and it has the weird behavior even in ROBLOX Studio. homermafia1 66 — 8y
Ad

Answer this question