Commands/Lua

Reference for console commands, Lua hooks and Lua commands in CS2D.

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Category: player (46)

Lua Hook kill

Categories

Parameters

  • killer: player id
  • victim: player id
  • weapon: weapon type id
  • x: death x (pixels)
  • y: death y (pixels)
  • killer object id: id of dynamic object that killed (or 0 if not killed by object)
  • assistant: player id (0 if no assistant)

Info

When a player is killed by another player.
killer is the player ID of the player who performed the kill. victim is the ID of the player who died. x and y define the position of this death on the map in pixels.

weapon can be a weapon type ID or a special source ID.

Weapon and item type IDs:
items

Special source IDs:
killids

If the player was killed by an object like a turret, gate field, barbed wire, NPC etc. then this field will contain the ID of this object. Otherwise (if the player was killed by another player or the environment) it will be 0

Assistant is the ID of the player who assisted the kill. A player will count as assistant if he dealt at least 40 damage. Assistant will be 0 if there was no assistant.

Note: The die hook works nearly the same. It will always be triggered too and allows you to avoid that the killed player drops items.
Attention: This hook will only be triggered if the kill was caused by a player (killer)!

Return Values

none - related action(s) [if there are any] performed by CS2D cannot be altered/omitted

Lua Command Lua Commands