Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Tindrone

Script not working (SOLVED)

Recommended Posts

I wrote a script where you have to kill 10 zombiemen and a door will open, however whenever i kill the ten zombies the door does not open, I have assigned a script execute command to the zombiemen but nothing happens.



#include "zcommon.acs"

int dead;


script 1 OPEN {
dead = 0;
while (dead < 10) {

delay(30);

Print(d: dead ,s:"/10");

}
}
script 2 OPEN {

while (dead >= 10){


Door_Raise(1,64,0,0);

}
}
script 3 (void)
{
dead += 1;
}

Share this post


Link to post

Delete script 2 and change script 1 into this:

script 1 OPEN {
  while (dead < 10) {
    Delay(30);
    PrintBold(d: dead ,s:"/10");
  }
  Door_Raise(1,64,0,0);
}
Use PrintBold instead of Print, because Print only prints to the script's activator, but OPEN script has no activator. Also note how Door_Raise is called after the loop ends, whereas in your script 2, it would be within a loop which quits itself before even being run once. Also, the variable "dead" is map scope, so its value will be automatically initialized as 0, no need to do it within the script. But if you want to clarify it, set its value to 0 on the same line where it's declared above the scripts:
int dead = 0;

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×