HELP
i have two scripts
but the script has been crashed
if i attack with my sword in the ennemy
his live dont less
that is the scripts
name=Aidan
#pragma strict
var diff:int;
static var ailife:int;
function Start () {
ailife=1;
}
function Update () {
if(diff==1){
ailife=10;
if(ailife<1){
Attributes.xp+=5;
Dead();
}
}
if(diff==2){
ailife=40;
if(ailife<1){
Attributes.xp+=20;
Dead();
}
}
if(ailife==3){
ailife=60;
if(ailife<1){
Attributes.xp+=33;
Dead();
}
}
}
function Dead(){
Destroy (gameObject);
}
the other
name=DanoNoAi
#pragma strict
function OnCollisionEnter(Collider:Collision){
if(Collider.gameObject.tag=="aii"){
AIdan.ailife-=10;
}
}