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

How can i get this script to work so that the mob goes to this point when it reaches 0 walk speed?

Asked by 3 years ago

am making a rpg where the mob goes back to its normal position when he is done following you, so he would stop moving and go back

this is the code

local monster = game.Workspace.Grass_Monster1
local Humanoid = monster.Humanoid

local pointA = game.Workspace.PointA

if Humanoid.WalkSpeed == 0 then
    Humanoid:MoveTo(266.565, 2.045, 814.35)
end

Grass_Monster1 is the mob am trying to move to this 266.565, 2.045, 814.35 position when he is not moving.

1
You cannot move an NPC or player if their walkspeed is 0. They won't move... This also does not seem to be in a loop of any sorts. So this will only check the condition once. PURGATORYAGENT_1 43 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

You cant move NPC's with 0 walkspeed. They just dont move.

0
nononon, what i meant is, when they reach 0 walk speed, so when they stop chasing the player, they start walking back to the position of whey they originally where amathebeastlol -7 — 3y
0
oh, i just realised the problem, sorry am dumb lol amathebeastlol -7 — 3y
0
Is there a way i could calculate the distance between the mob and the player and if the player is further then a certain point the mob would go back, is that possible? or is there a simpler way amathebeastlol -7 — 3y
Ad

Answer this question