I want to make this if then statement occur if the scripts math.random chooses "animation1"
local anims = {script.Animation1,script.Animation2}
local chooseattack = math.random(2)
local animation = hum:LoadAnimation(anims[chooseattack]) --this will load a random animation, from the array, into the player
animation:Play() -- plays it
if animation == 1 then

2 comments
well i can obviously see lua isnt your first language. Also what you answered is pretty much the same as mine except worded differently, but ill try it out.
No, it's not, haha. A couple of changes, particularly in changing (animation == 1) to (attack == 1), but other than that your script was pretty solid. :)