Trigger Contents

The Trigger Contents package tracks what entities are inside a trigger at any given time.

Usage

  • Install the Trigger Contents package
  • Place the triggerContentsScript on any trigger
  • Use triggerContentsScript.contents to get an array of all entities within the trigger

You can also use :ForEachEntity(callback) to iterate the contents

Example

function MyScript:OnInteract()
  self.properties.trigger:SendToScripts("ForEachEntity", function(entity)
    print(FormatString("{1} is inside the trigger", entity:GetName()))
  end)
end
1 Like