button = script.Parent
asset = button.DanceAsset
gui = button.Parent
player = gui.Parent.Parent
char = player.Character
humanoid = char.Humanoid
function Click()
if humanoid:findFirstChild("AnimationController") then
local controller = humanoid.AnimationController
if controller:findFirstChild("DanceAnimation") then
dance = controller.DanceAnimation
dance.AnimationId = asset.Value
local animation = humanoid:LoadAnimation(dance)
animation:Play()
end
end
end
button.MouseButton1Click:connect(Click)
Meant to play an animation |