Jump to content
Sign in to follow this  
Sarge46

Check if something dies then give points

Recommended Posts

What would a script/command look like to check when something dies, add a point to a variable, lets say variable "variablex".

I'm just getting started in this scripting business.

Share this post


Link to post
Share on other sites

Very easy. Add a killed eventhandler to the units you wanna count, such as :

this addeventhandler [{killed},{variablex=variablex+1}]

in the init line of the unit.

To add this counter to, let's say all OPFOR units, make a trigger covering all units, activation by OPFOR, present, once, and put this in the on activation line of the trigger :

{_x addeventhandler [{killed},{variablex=variablex+1}]} foreach thislist

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×