local animation = script:WaitForChild(‘Animation’)
local humanoid = script.Parent:WaitForChild(‘Humanoid’)
local dance = humanoid:LoadAnimation(animation)
dance:Play()
@killerrdrohne ok so, most of the roblox catalog emotes are r15, is your dummy r6 (6 limbs instead of 15), cuz they wont play cuz your rig is incorrect
you need to reference the animator for animations as well.
local animation = script:WaitForChild("Animation")
local plr = game.Players.LocalPlayer
local chr = plr.Character
local humanoid = chr:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local dance = animator:LoadAnimation(animation) -- From line 1
dance:Play()
local animation = script.Parent:WaitForChild(‘Animation’) -- script.Parent:WaitForChild(...) instead of script:WaitForChild(...)
local humanoid = script.Parent:WaitForChild(‘Humanoid’)
local dance = humanoid:LoadAnimation(animation)
dance:Play()
Your script doesn’t have a child named “Animation”; it’s named “Idle.”
local animation = script:WaitForChild("Idle")
local humanoid = script.Parent:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local dance = animator:LoadAnimation(animation)
dance:Play()
If your animation is not on loop, it will play only one time once the script is loaded. For example when You start the game, if your rig is already on workspace, the script inside the rig will run once the game starts. In your case the code run one time and then stops. You need an event to trigger the animation when you need to. Local Scripts don’t run on workspace.