Help with Avatar Statue Emotes

Hello I am trying to make a game called “Dayron Grill” and have for the last hour been searching for how to make a statue of my avatar doing a dance. I tried some tutorials (None Worked) and I have never scripted something like this before.

The animation I want to use is:

https://www.roblox.com/catalog/4049646104/Line-Dance

Hopefully someone knows how because I don’t want to spend too much time on this. I need to work on the building itself and I might not have time if this takes a day.

local Players = game:GetService("Players")
 
local player = Players:WaitForChild('AidanPlaysYT_Real')
 
local character = player.Character or player.CharacterAdded:Wait() 
local humanoid = character:WaitForChild('Humanoid')
 
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=4049646104" -- Roblox dance emote
 
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()
--[[Might also try:
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        local Animation = Instance.new('Animation', workspace)
        Animation.AnimationId = 'http://www.roblox.com/asset/?id=4049646104'
        local AnimTrack = char:WaitForChild('Humanoid'):LoadAnimation(Animation);AnimTrack:Play()
    end)
end)

Source: Animation | Documentation - Roblox Creator Hub (Edited a bit, because it was outdated and more likely wouldn’t work…)

2 Likes

You sure it will work on avatar in the workspace that stands there. I don’t want it to work on the real player only the statue.

Aidan, You want to make a statue that has an animation playing in it?

1 Like

Yes that is exactly what i want. Not a statue of parts but a person dancing. Same type of code as an avatar, but its a statue.

insert an animation into character and put the Id into the animation place
(Put this in the character)
local anim
local h = script.Parent.Humanoid
if h then
anim = h:LoadAnimation(script.Parent.Animation)
end

1 Like

What’s the purpose of that code? You never use anim:Play() so there’s no real point in using that.

1 Like

Heres the script you have to use; sorry for it being late.

--[[
Here's a few things you should notice before using this:
1. Don't use the EMOTE ID, use the ANIMATION ID that is attached to an emote.
2. If you want to use a different dance, make sure you have BTRoblox installed. When you're on the page of the EMOTE you'd like to use, click the icon that looks like a picture, and it will redirect you to the ANIMATION it's linked to. Make sure you copy the id from the ANIMATION url! :)
3. Make sure your character isn't anchored anywhere, this will automatically anchor the needed part(s).
]]
local DanceAnimationId = 4049037604

local DancingCharacter = script.Parent
DancingCharacter:WaitForChild('HumanoidRootPart').Anchored = true

local Animation = Instance.new('Animation')
Animation.AnimationId = "rbxassetid://" .. DanceAnimationId
Animation.Parent = DancingCharacter.Humanoid

local AnimationTrack = Animation.Parent:LoadAnimation(Animation)
AnimationTrack:Play()

Put this right inside the character, not in the humanoid! I’d recommend changing the name to something like AnimationPlayer or something so you know what this script does.

If you need any additional help, tell me and I can help you out.

2 Likes

Thank you, I will do this after they fix Roblox Studio today! On the rbxassetid part do i add the animation id at the end or leave that the same?

I put in the animation id for you, to change the animation, change the DanceAnimationId variable, not the animationid of the animation itself. :slight_smile:

1 Like

oh, okay hopefully it works! I have been searching FOREVER and finally someone has showed me it.

1 Like