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

team killer!

Recommended Posts

I have a map where a group of marines
attack a base, now how can i script
where say like if 5 marines die then
kill the player? can someone give me
an a script example? because i don't
know how to script something like that.

Share this post


Link to post

Give all the marines the same tid then do something like this:

if(!thingcount(0, x))
   DamageThing(400);
else
{
   delay(1);
   restart;
}
This assumes that there are a total of five marines with tid x, the real formula would be if(thingcount(0, x) == (total_marines - 5))

That has to be either an enter or a void script as well, the difference being enter scripts are executed when the map starts and void scripts are started in the game via some event. If you're going to make it a void script make sure that you have the player execute it, as DamageThing() is applied to whoever executed the script.

Alternativly I believe you could do something like TakeInventory("Health", GetInventory("Health")) (not sure if I have that syntax right) which would kill the player 100% of the time regardless of who executed the script (for instance if the marines kill each other).

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
×