i have made a melee script but it is not doing anything at all here it is:
var InCombat : boolean = false;
static var EnemyHealth;
static var MeleeLevel;
var SwordBonus = 20;
function Start(){
InCombat = false;
if(Input.GetKeyUp(KeyCode.F)){
Attack();
}
}
function Attack(){
InCombat = true;
if(Input.GetKeyUp(KeyCode.F)){
EnemyHealth -= SwordBonus * MeleeLevel / 4;
}
}
i want it to so if when it starts you are not in combat so you can not attack right away but if you press f then it turns combat on and you can attack right away but it does not do anything to the enemy i have enemy health script but it does not take damage from my script every time i press f the boolean doesn't even turn on or the enemy doesn't take damage please help.
↧