SmartTriggerScript

Trigger script for OnTriggerEnter. Select either, no players or entities are in trigger area.

Enhancement:

  • designed for players or entities
  • uses 2 schedules
  • uses 1 Table to track triggerbox

example: Star Trek door to stay open if two people enter it and one person walks away from it.

Howto use:

  • Assign to a trigger
  • OnTriggerEnter
  • select the trigger
  • select the script
  • select “OnTriggerEnter” function
  • OnTriggerExit is left blank, see onTriggerExit in SmartTriggerScript

SmartTriggerScript:

  • isNotPlayer (check to select an Entity vice the player)
  • isEntity (populate this only if the box is checked above)
  • onEnter (event to trigger when entity/player is in box)
  • enterSound (if a sound is desired to play, select it from the entity it is attached to)
  • onExit (event to trigger when the triggerbox is empty)
  • exitSound (if a sound is desired to play onExit, select it from the entity it is attached to)

Note: the code is commented