Commands/Lua 4p354
Reference for Lua commands in CS2D. 2n6e1u
- parse
- Lua Hooks execute Lua when events occur - some have a return value which can change the game behavior
- Lua Commands are used to retrieve game data or to perform actions in Lua scripts
CS2D Console Commands 1x2j11
Lua Hooks 4f5c5b
kill 39656i
Categories 3d3dx
Parameters 5z4x5d
- killer: player id
- victim: player id
- weapon: weapon type ID / special source ID
- x: death x (pixels)
- y: death y (pixels)
- killerobject: id of dynamic object that killed (or 0 if not killed by object)
- assistant: player id (0 if no assistant)
Info 36691t
When a player (victim) is killed by another player (killer).
weapon can be a weapon type ID or a special source ID. x and y define the position of this death on the map in pixels.
If the player was killed by an object like a turret, gate field or barbed wire then killerobject will contain the ID of that 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.
Weapon and item type IDs:

Special source IDs:

weapon can be a weapon type ID or a special source ID. x and y define the position of this death on the map in pixels.
If the player was killed by an object like a turret, gate field or barbed wire then killerobject will contain the ID of that 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.
Weapon and item type IDs:

Special source IDs:

Note: The die hook works nearly the same. It will always be triggered too and allows you to avoid that the victim drops items.
Attention: This hook will only be triggered if the kill was caused by a player (killer) - either directly (weapon) or indirectly (buildings etc.)!
Return Values t6z4k
none - related action(s) [if there are any] performed by CS2D cannot be altered/omitted