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

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

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()

1 comment

0

The :WaitForChild is not needed as the "WalkAnim" is the animation itself.

1 answer

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)

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