Commands/Lua

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

CS2D Command CS2D Console Commands

Lua Hook Lua Hooks

Lua Command Lua Commands

Category: all (86)

Lua Command randomhostage

Categories

Parameters

  • [unused] (optional)

Info

Returns the tile x and y position (2 values!) of a random living and unused (not following anyone) hostage. Returns -100,-100 if no hostage has been found. Set unused to 0 if you want to get used hostages as well!

Note: The returned position is in tiles, NOT in pixels!


Note: Returns 2 values, see example!


Sample 1: Getting the position of a random hostage
x,y=randomhostage()