So when a player clicks once, it plays [1] If a player clicks twice, before 0.3 seconds are over, it plays [2] If a player clicks three times, before 0.5 seconds, it plays [3] If they don't click before the certain time limit, it plays 1. The issue I keep getting is if a player clicks twice, it plays both 2 AND 3. How do I fix this?
function button1Down()
if (activated and not animating) then
if (secondSlash and tick()-secondSlashTime < 0.3) then
slash[2]()
secondSlash = false
if (activated and not animating) then
if (thirdSlash and tick()-thirdSlashTime <0.5) then
slash[3]()
thirdSlash = false
end
end
else
slash[1]()
secondSlash, secondSlashTime = true, tick()
thirdSlash, thirdSlashTime = true, tick()
end
end
end
