I’ve done a timer script so when in battle once player has attacked the enemy it’s suppose to count down the timer from 10 and when ) is hit, it lets my player attack again (ie, attack menu pops back up) very much like FF10 / FF10-X2
Script attached below if anyone can figure out whats happening with it, the menu doesn’t pop backup and the timer only goes to 9 and nothing else.
var timer : int = 10;
function Update () {
if(turn == 2 && enemyTurnActivated == false) {
enemyTurnActivated = true;
enemyTurn();
} timer -= Time.deltaTime;
}
function enemyTurn () { player.SendMessage("damagePlayer", Random.Range(1,10));
if (timer <= 0)
{
turn = 1;
enemyTurnActivated = false;
}
}