Animation wont stop playing dispite being told to stop

im trying to add a sitting animation to my hangout game, so people can sit and vibe with other players
The issue is that the sitting animation does not stop playing, dispite being told to stop, other animations, AND changing JumpPower doesnt seem to function either. play over it dispite it having the correct priority

Ive tried replacing the default sitting animation entirely to see if that would fix both the priority bug and the animations playing over, when I looked this up people have had similar problems and the solution provided doesnt work or no longer works.
this is the script im using:

local btn = script.Parent
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid",10)
local CanEmote = true


btn.MouseButton1Click:connect(function()
	if CanEmote == false then
		local dance = hum:LoadAnimation(script:FindFirstChild("Animation"))
		hum.JumpPower = 15
		hum.WalkSpeed = 15
		dance.Looped = false
		dance:Stop()
	end

	if CanEmote == true then
		hum.JumpPower = 0 -- you can remove this, this really fixes it..
		hum.WalkSpeed = 0 -- this too 
		CanEmote = false 
		local dance = hum:LoadAnimation(script:FindFirstChild("Animation"))
		dance.Looped = true
		dance:Play()
		
	end
	
end)

you should glue the two if statements together with an elseif, and also re-set the CanEmote to true after unsitting, like this:

--mouse click function
Button.MouseButton1Click:Connect(function()
    if CanEmote == false then
     >> CanEmote = true <<
        Animation:Stop()

    elseif CanEmote == true then
        CanEmote = false
        Animation:Play()

    end
end)

that worked! thanks!, now i need to figure out the jump power issue lol