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

I'm trying to load a animation into a npc but its says im missing an argument?

Asked by 5 years ago
Edited 5 years ago

I tried with a local script and a usual script none of them work

The code:

local Humanoid = script.Parent:WaitForChild("Humanoid")

local animation script.Parent.WalkAnim:WaitForChild(animation)

local anim = Humanoid:LoadAnimation(animation)

wait(3)

anim:Play()

0
The :WaitForChild is not needed as the "WalkAnim" is the animation itself. Divistern 127 — 5y

1 answer

Log in to vote
0
Answered by
blockmask 374 Moderation Voter
5 years ago

Well, in your script you have local animation (animationPath), without you setting an equal sign to that variable, it makes the value of the variable nil. So.. humanoid:LoadAnimation(animation) is basically humanoid:LoadAnimation(nil). That's why is says you're missing an argument. To simply fix this, just do local animation = animationPath)

Ad

Answer this question