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.
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)
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
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.