New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

My NPC animation only work when you run the game but not play the game. Why?

Asked by 12 days ago

My NPC animation won't work when I play the game, I need to know what's wrong. This is my code. The code is in a normal script, not local script.

local char = script.Parent --the npc local hum = char:WaitForChild("Humanoid") --the npc's humanoid local animation = hum:LoadAnimation(script.Animation) --finds the animation inside the script and loads it in the npc's humanoid

if hum ~= nil then animation.Looped = true animation:Play() end

1
Can you post your code in the right format so that it's easier to read and respond too FallenZalio 33 — 11d

Answer this question