My Boss Death Script Isn't Working

Hello! So I’m making a boss for my game, the issue is a lot of stuff for it isn’t working

    1. After an Attack, the Idle animation doesn’t load and the boss just freezes in place with no animation
    1. When the Boss’s health is 0 it just still does the idle animation and the Boss just kind of falls over ( Because I have don’t break Joints On Death so the Animation Can Play )

Heres the Code

local Boss = script.Parent
local character = script.Parent
local humanoid = character:FindFirstChild("Humanoid")
local AttackList = {"Punch", "Stomp"}
local ChosenAttack = nil
local IdleAnim = script.Idle
local PunchAnim = script.Punch
local StompAnim = script.Stomp
local DrillAnim = script.Drill
local DeathAnim = script.Death
Boss.Humanoid.BreakJointsOnDeath = false


local animationTrack = humanoid:LoadAnimation(IdleAnim)

animationTrack:Play()

while true do
	if Boss.Humanoid.Health == 0 then
		local animationTrack = humanoid:LoadAnimation(DeathAnim)

		animationTrack:Play()
		break
	end
	
	wait(5)
	ChosenAttack = AttackList[math.random(1, #AttackList)]
	if ChosenAttack == "Punch" then
		local animationTrack = humanoid:LoadAnimation(PunchAnim)
		
		animationTrack:Play()
		wait(1)
		local exp = Instance.new("Explosion")
		exp.Name = "Explosion"
		wait(1)
		exp:Destroy()
		local animationTrack = humanoid:LoadAnimation(IdleAnim)

		animationTrack:Play()
	end
	
	if ChosenAttack == "Stomp" then
		local animationTrack = humanoid:LoadAnimation(StompAnim)

		animationTrack:Play()
		wait(1.12)
		local exp = Instance.new("Explosion")
		exp.Name = "Explosion"
		wait(1)
		exp:Destroy()
		local animationTrack = humanoid:LoadAnimation(IdleAnim)

		animationTrack:Play()
	end
end

Not at all, I would have stated that as I would most of the time remember to do, Its dumb to make a post without more info anyway