Author Topic: Death and item detection  (Read 451 times)

I am trying to do a script that will detect when a player was killed, and if that player was holding an item, mainly for a autokick system i'm doing, how would I do this?

Someone should make a script that does the following:
  • When a player dies it checks if they had an item(or weapon) on hand
  • If they did not it kicks the person that killed them from the server
This would stop free killing a little in jail RPs
Lol


package function GameConnection::onDeath(%client,%obj,%killer,%type,%area). %client will be the client of the person killed, %killer will be the killer.

to kick them just delete their client (not to be confused with the player)

As for checking whether the player is holding an item, use if(isObject(%client.player.getMountedImage(SLOT))).

package function GameConnection::onDeath(%client,%obj,%killer,%type,%area). %client will be the client of the person killed, %killer will be the killer.

to kick them just delete their client (not to be confused with the player)
As for checking whether the player is holding an item, use if(isObject(%client.player.getMountedImage(SLOT))).

Alright, thanks all :D