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

NPC Animations aren't working, no output except for prints?

Asked by 5 years ago

So I have an NPC that moves and does NPC stuff, but it doesn't play animations. I have this script

``` local controller = script.Parent.Humanoid

local walk = Instance.new("Animation")

walk.AnimationId = ("rbxassetid://837009922")

local walktrack = controller:LoadAnimation(walk)

walktrack.Looped = true

local idle = Instance.new("Animation")

idle.AnimationId = ("rbxassetid://837011741")

local idletrack = controller:LoadAnimation(idle)

idletrack.Looped = true

script.Parent.Humanoid.Running:Connect(function(speed)

if speed ~= 0 then

walktrack:Play()

idletrack:Stop()

print("Walking")

elseif speed == 0 then

walktrack:Stop()

idletrack:Play()

print("Not walking")

end

end) ```

But it uh... doesn't do anything. I don't get any errors, but I do get 'Walking' and 'Not Walking'. Any help?

0
It's a problem with your actual animations, not the script. Try replacing your IDs with ROBLOX's default ones as a test: rbxassetid://913402848 for walk and rbxassetid://507766388 for idle. whenallthepigsfly 541 — 5y
0
Yes! that worked! can you post an answer so i can accept it? DaBrainlessOne 129 — 5y

Answer this question