NPC Not Dancing

Hey developers! My NPC isn’t dancing. I am wondering whether or not the script is wrong, I put the script and animation in the wrong spot so I am wondering if you can help.

local tool = script.Parent
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://5829546372"
local track = track = script.Parent.Humanoid:LoadAnimation(Anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = true
track:Play()

Screenshot (8)

Hmm, I have a game called Chowder Monkey and my NPC’s animation wasn’t working. I found this script but you might have to type the animation twice sense it seems it only takes multiple assets (Sense it says IDs).

Asset = “http://www.roblox.com/Asset?id=

IDs = {564438776,50777192104}

Anims = {}

AnimsL = {}

Human = script.Parent:WaitForChild(“Humanoid”)

for i=1, #IDs do

local Anim = Instance.new(“Animation”)

Anim.AnimationId = (Asset…IDs[math.random(1,#IDs)])

table.insert(Anims,Anim)

wait()

end

for i=1, #Anims do

local AnimL = Human:LoadAnimation(Anims[i])

table.insert(AnimsL,AnimL)

wait()

end

while true do

local Dance = AnimsL[math.random(1,#AnimsL)]

Dance:Play()

wait(15)

end

Where it shows two ID’s, put 5829546372 twice their.

I’m not sure if this will work, I’m not a scripter and this is something I found.

I am confused. What? Where would I put the ID twice?

Where it says “IDs = {564438776,50777192104}”
2nd line.

Instead of putting the animation in the humanoid, can the you try putting under the server script?
Also, I don’t think you should make the looped true, I think you could use it in a while loop and play that animation again and wait for it to play finish and play the animation again.

1 Like

I will try both. Will report back.

I can’t figure out your script. Do you know how to format it in a post?

'Asset = “http://www.roblox.com/Asset?id=”

IDs = {5829546372,5829546372}

Anims = {}

AnimsL = {}

Human = script.Parent:WaitForChild(“Humanoid”)

for i=1, #IDs do

local Anim = Instance.new(“Animation”)

Anim.AnimationId = (Asset…IDs[math.random(1,#IDs)])

table.insert(Anims,Anim)

wait()

end

for i=1, #Anims do

local AnimL = Human:LoadAnimation(Anims[i])

table.insert(AnimsL,AnimL)

wait()

end

while true do

local Dance = AnimsL[math.random(1,#AnimsL)]

Dance:Play()

wait(15)

end’

Zeus, nothing worked :confused: And chasing. When replying above the top of the text box it says Preformatted text. Then click it then copy and paste the code each line by line.

I believe Roblox doesn’t load animations if you don’t own them like in a group inside of studio. Have you tried it in-game?

is the npc anchored because i think they wont play if it is anchored

Yeah. and the NPC isn’t anchored.

Hmmmm, Is it a group game, and is the Animation by the group?

Why is this in Building Support if it should be in Scripting support?