onClientDeath

From Liberty Unleashed Wiki
Revision as of 20:54, 11 November 2013 by Thijn (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This event is called when the local player dies

Syntax

  1. function onClientDeath( killer, weapon, bodypart)

Arguments

  • killer - The pointer to the player who killed the local player
  • weapon - The weapon used
  • bodypart - The bodypart hit

Returns

This event does not handle return values.

Example

This will show a message saying who killed the player.

  1.  
  2. function onClientDeath( killer, weapon, bodypart)
  3. {
  4. local pPlayer = FindLocalPlayer();
  5. if ( pPlayer && killer )
  6. {
  7. Message("HA! You got killed by " + killer.Name);
  8. }
  9. }
  10.  

Notes

The functions FindLocalPlayer and Message were used in in this example. More info about them in corresponding pages.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox