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

Can anyone help with NPC Animations? and im a new developer.

I have tried making an npc animation The script goes like this, wait

wait(3)
local hum = script.Parent.Humanoid

local anim = hum:LoadAnimation(script.Parent.Animation)

anim:Play()

Can anyone fix this for me?

2 comments

0

Are you using a local script?

0

No

2 answers

I think this is a question about scripting rather than animation.

I'm not sure but do you need the script to wait for "hum" to exist and go from there?

local hum = script:FindFirstAncestorOfClass("Humanoid")
local anim = hum:LoadAnimation(script.Parent.Animation)
anim:Play()

1 comment

0

Thanks but its not working do i have to put the animation into the script or out?

local hum = script.Parent:FindFirstChild("Humanoid")
local anim = hum:LoadAnimation(ANIMATIONPLACE) --Put in ANIMATIONPLACE the place of the Animation
anim:Play()

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