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

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

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 comment

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.

1 answer

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

3 comments

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

0

oh, i just realised the problem, sorry am dumb lol

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

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