Basically all I want for this to do is play the animations in the table(array) randomly when you press "q" but it doesn't work..any help?

wait(2)
Player = game.Players.LocalPlayer
char =Player.Character
mouse = Player:GetMouse()
RA = char["Right Arm"]
LS = char.Torso["Left Shoulder"]
animation = script:WaitForChild("Animation")
animation2 = script:WaitForChild("Animation2")

local array = {animation, animation2}

k = true
function OnKeyDown(key)
	key:lower()
	if key == "q" then
		if k == true then
		k = false
		script.Punch.Value =4
		script.punch:Play()
		-- animationTrack = Player.Character.Humanoid:LoadAnimation(animation,animation2)	
		--animationTrack:Play()
		local anim = array[math.random(1, #array)]
		array()
		wait(2)
		script.Punch.Value = 0
		k = true
	end
	end
	end



mouse.KeyDown:connect(OnKeyDown)