Hey everyone, hope you’re staying safe. I’m trying to make an NPC that plays the Monkey Dance. Though, I haven’t figured out how. I tried doing this, but couldn’t figure out how it works out.
Here’s the code I tried:
--Variables--
local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local hum = script.Parent:WaitForChild("Humanoid")
if hum then
print("Success")
else
print("No Humanoid")
end
local humanim = game.InsertService:LoadAsset(3716636630).Parent
--Playing Animation--
if enabled.Value == true then
humanim:Play()
humanim.Looped = true
humanim:AdjustSpeed(sp.Value)
end
Any help is appreciated, also I am quite new to animation playing.
I understand that. You’d create an animation instance, with the animation ID being the emote you are attempting to play. The above script would work for this.
--Variables--
local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local humanoid = script.Parent:WaitForChild("Humanoid")
--Playing Animation--
local animation = script.Animation
animation.AnimationId = 3716636630
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()
This is the code, and it did not play the animation. Have I specified the humanoid incorrectly?
Your ID isn’t right. You probably copied the id from the url in the catalog? Well for some reason roblox decided to put another ID there (That’s the ID of the emote I think, not the animation). But basically I use the chrome extension BTRoblox which lets me see the animation that is “hidden” behind the emote. This is the ID of the “Monkey” animation: 3333499508.
After you install the extension and go to an emote in the catalog you should see something like this:
You need to click it and then you can see the animation behind the emote and it’s ID: