Entities

Entities can be used in the map editor to specify player spawn locations or to add effects, doors, items and more.

Category: all (50)

96 - Trigger_If (If)

Info

Evaluates a Lua expression and triggers when it is true. The Lua evaluation runs in the same Lua space as all other Lua scripts (map scripts and server scripts) so you can use functions and variables from these scripts.

Sample 1: Always trigger
true

Sample 2: Never trigger
false

Sample 3: Only trigger if the Lua variable "sample" has the value 5
sample==5

Sample 4: Only trigger if the Lua variable "sample" has a value between 3 and 7 (4,5,6)
sample>3 and sample<7

Sample 5: Only trigger if there is a player with ID 1 on the server
player(1,"exists")

Attention: The server setting mp_luamap must be 1 to make this work.
Attention: This entity can be abused to execute malicious Lua code. For this reason mp_luamap is set to 0 by default!

Values / Properties

The following values can be set in the entity properties menu of the map editor and can be read using the Lua command entity.

  • strs[0]=Lua expression to evaluate