I have tried numerous times, to make a script where when an NPC's speed hits 0 it stops playing an animation, but all I got is when it goes to 0 it still plays. Its kind of annoying (Also would this work for a morph (StarterCharacter?) ) This is my script so far.

--HurtSins 2019

local hum = script.Parent:WaitForChild("Zombie")
local anim = hum:LoadAnimation (script:FindFirstChildOfClass("Animation"))
anim.Looped = true
anim:Play()

3 comments

0

(The NPC's humanoid is called "Zombie.")

0

Now that I've added the code block... Can you please display the code you've written for when the humanoid's walkspeed hits zero?

0

You never defined "script" on line 4