Blockland Forums > Modification Help

Last guy standing script

Pages: (1/3) > >>

aml:

I'm not very good with scripting, so far all I can do is make a /help cmd.I just thought I should let you know. Anyways I need a script that notifies the players when there is only one man left on one of the two teams. An example would be like...
This Guy Killed That Guy.
(Name of the last guy) is the only one left on (Team name).
I would script this myself, but I really have no idea on how I would do it.
It would be nice if someone could explain it to me though.

herb:

you need to package the on death function, and check all players alive.
i am not going to give you the code, maybe 2morow i will, or someone else might

aml:

So it would basically be something like this.


--- Code: ---package Test
{
function gameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc)
{
parent::onDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc);
messageclient(%client,"","You died fool.");
}
};
activatepackage(Test);
--- End code ---
Edit: I started to mess with the script some and this is what I have so far. It isn't much though.
Now I just needs to somehow recognize how many players are left on each team, and then once there's only one left it says the message.

aml:

Bump.

Chrono:

Loop through the minigame's members.
Check if they're on the same team as the one who died.
Count the number of them that are alive.

Pages: (1/3) > >>

Go to full version