Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way I can make an NPC do an animation via a ROBLOX emote?

Asked by 4 years ago

So in the Catalog of emotes, I stumbled across this emote. I created an NPC and used this following code:

local animation = "https://roblox.com/catalog/3823158750/Godlike"
local humanoid = script.Parent:WaitForChild('Humanoid')
local dance = humanoid:LoadAnimation(animation)
dance:Play()

But it doesn't work. I'd assume it's Line 1 causing the issue, but I'm not the professional here. All help is appreciated.

0
is the Model r15? no0bgaming748 24 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Here is the Fixed script:

local animation = Instance.new("Animation", workspace.NPC)
animation.AnimationId = "rbxassetid://3337994105"
local human = workspace.NPC.Humanoid
local dance = human:LoadAnimation(animation)
dance:Play()

Make sure the NPC is unanchored, but also you CAN anchor the HumanoidRootPart. Also, you were using the emote, not the animation. I have the animation here. You need an instance of an animation, not just the ID. Happy to help, b_mni.

0
make sure the NPC is r15 User#29913 36 — 4y
0
What do you mean, "Emote, not the animation" LennyPlayzYT 269 — 4y
0
The emote is the emote that you see when going to buy it, the animation is INSIDE the emote. User#29913 36 — 4y
Ad

Answer this question