Hello I am trying to make zombies respawn on this game I am making.
So far i have
Is this code wrong??
Or what is it???
What this is supposed to do is when the valueprint = 0 it stops all parts of the zombies then resets them.
When I "Check Script" no errors come up.
So far i have
Code: [Select]
int group = OBJ_0;
int skinmesh = OBJ_22;
int valueprint = OBJ_44;
int zombiescript = OBJ_66;
int zombiechar = OBJ_88;
int zombierigid = OBJ_110;
int zombiepath = OBJ_132;
int zombiesound = OBJ_154;
bool dead = false;
bool reborn = false;
bool alive = true;
int zombiehealth = IN_44;
///-----------------------------------------------------
/// Main |
///-----------------------------------------------------
void Main(){
if(alive == true){
if(zombiehealth <= 0){
dead = true;
Death(); //start death process
}else{
return;
}
}
}
///------------------------------------------------------
/// Death |
///------------------------------------------------------
void Death(){
if(dead == true){
iObjectStop(group);
iObjectHide(skinmesh);
iObjectStop(zombiescript);
iObjectStop(zombiechar);
iObjectHide(zombierigid);
iObjectStop(zombiesound);
reborn = true;
Reborn();
}else{
Main();
}
}
///------------------------------------------------------
/// Reborn |
///------------------------------------------------------
void Reborn(){
if(reborn == true){
iObjectReset(group);
iObjectReset(skinmesh);
iObjectReset(zombiescript);
iObjectReset(zombiechar);
iObjectReset(zombierigid);
iObjectReset(zombiesound);
alive = true;
dead = false;
}
Main();
}
But every time I press spacebar to see if it works 3D freezes. Is this code wrong??
Or what is it???
What this is supposed to do is when the valueprint = 0 it stops all parts of the zombies then resets them.
When I "Check Script" no errors come up.