I made a custom rig morph with a UI where you can do certain animations. The buttons play an animation when clicked. It plays the animation once without looping it. However, when I tested it, it didn't work. It basically combined the idle animation and the button's animation together, forming a weird, simple animation. I've tried making a thing where it stops and plays the idle animation, but didn't work. Here is the error that came out of the output and the main part of the script.
Error
Stop is not a valid member of Animation "Workspace.Office_Bucket.BaseAnimate.idle.Animation1"
Script
player = script.Parent.Parent.Parent.Parent.Parent.Parent.Character
function onClicked() -- You can edit these functions to do a certain thing.
if script.Parent.Parent.Parent:FindFirstChild("Action") ~= nil then --Don't edit this
script.Parent.Parent.Parent.Action:Play()
end
local Animation = player.Humanoid:LoadAnimation(script.Emote)
wait(0.1)
player.BaseAnimate.idle.Animation1:Stop()
wait(.1)
Animation:Play()
script.Disabled = true
script.Parent.Visible = false
wait(1)
player.BaseAnimate.idle.Animation1:Play()
wait(.1)
Animation:Stop()
script.Disabled = false
script.Parent.Visible = true
end
If anybody knows how to fix this, please tell me.

2 comments
make sure that it is a local script to detect the button press leading into a remote event which then the regular script picks it up and makes the person to a animation
Is the animation high priority?