local HandsUpAnimation = game.Workspace.HandsUp
local Humanoid = game.Players.LocalPlayer:WaitForChild("Humanoid")
local PlayAnimationButton = game.Players.LocalPlayer.PlayerGui:WaitForChild("Annimations").HandsUp
PlayAnimationButton.MouseButton1Click:Connect(function()
LoadAnimation = Humanoid:LoadAnimation(HandsUpAnimation)
LoadAnimation:Play()
end)
PlayAnimationButton.MouseButton1Click:Connect(function()
LoadAnimation:Stop()
end)
1st Goal: Trying to make this animation play when you press a button, and when you press it again it stop’s playing the animation.
2nd Goal: I made a hands up animation in Moon Animator, but when I play it the animation will show but then return to normal player position. How can I make it where it will show the hand’s when you press a button and it ill show that position forever until pressing the button again?
Some solutions I’ve tried was looking on websites and etc.
local HandsUpAnimation = game.Workspace.HandsUp
local Humanoid = game.Players.LocalPlayer:WaitForChild("Humanoid")
local PlayAnimationButton = game.Players.LocalPlayer.PlayerGui:WaitForChild("Annimations").HandsUp
local LoadAnimation = Humanoid.Animator:LoadAnimation(HandsUpAnimation)
local Playing = false
PlayAnimationButton.MouseButton1Click:Connect(function()
if not playing then
LoadAnimation:Play()
else
LoadAnimation:Stop()
end
Playing = not Playing
end)
local HandsUpAnimation = game.Workspace.HandsUp
local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local PlayAnimationButton = game.Players.LocalPlayer.PlayerGui:WaitForChild("Annimations").HandsUp
local LoadAnimation = Humanoid.Animator:LoadAnimation(HandsUpAnimation)
local Playing = false
PlayAnimationButton.MouseButton1Click:Connect(function()
if not Playing then
LoadAnimation:Play()
else
LoadAnimation:Stop()
end
Playing = not Playing
end)