I'm trying to make an attack that adds a random debuff but for some reason,n it keeps on executing the else statement and setting the the buff to luck (luk) everytime
<target action>
var random = Math.floor(Math.random() * 6) + 1;
if random === 1
add atk debuff: target, 1, show
else if random === 2
add def debuff: target, 1, show
else if random === 3
add mat debuff: target, 1, show
else if random === 4
add mdf debuff: target, 1, show
else if random === 5
add agi debuff: target, 1, show
else
add luk debuff: target, 1, show
end
</target action>
<target action>
var random = Math.floor(Math.random() * 6) + 1;
if random === 1
add atk debuff: target, 1, show
else if random === 2
add def debuff: target, 1, show
else if random === 3
add mat debuff: target, 1, show
else if random === 4
add mdf debuff: target, 1, show
else if random === 5
add agi debuff: target, 1, show
else
add luk debuff: target, 1, show
end
</target action>