Okay, there are several minor things ill pick up on because nobody else has yet.
%var = %var + 2; is the same as
%var += 2; but it looks a lot nicer. There is also
-= *= /= which have similar effects.
%var = %var + 1; or
%var += 1; is the same as
%var++; , it simply increases it by one. You can also use
%var--; to decrease it.
And just to confirm, you only need
serverCmdXXX in a function when you want players able to do
/XXX or if you want a client sided script to talk to a server sided script, but that's a whole other topic.
Edit: gameConnection::onDeath works, but not on bots.
The reason for this is that a GameConnection is a client. Technically, a client is an 'invisible' object which stores information about the people who are connected to the server. When a person connects, a GameConnection is created, and when they leave it is deleted. If a GameConnection is ever deleted, the person who it belongs to is disconnected. A Player object on the other hand is visible, moves around, and is deleted when the player dies (or when they join a minigame, or whatever).
Usually, a client will have a single player, which you can get using
%client.player , however you should always check to make sure they're existent (not deleted), by using the
isObject(%obj) function. eg
if(isObject(%client.player)) { %client.player.kill(); } . You can get a player's client from
%player.client but again you should check to make sure they have one, because
%player could sometimes be a bot (depends entirely of what you're doing).
I rambled a little, the reason it doesn't work is because bots don't have a client. You want a function for a Player, or an Armor (which is a player datablock, dont worry too much about it, just learn its arguments).