Garry's Mod Wiki

ENTITY:StoreOutput

  ENTITY:StoreOutput( string name, string info )

Description

Used to store an output so it can be triggered with ENTITY:TriggerOutput. Outputs compiled into a map are passed to entities as key/value pairs through ENTITY:KeyValue.

TriggerOutput will do nothing if this function has not been called first.

Arguments

1 string name
Name of output to store
2 string info
Output info

Example

Stores all outputs that are assigned to an entity in Hammer.

function ENT:KeyValue( k, v ) -- 99% of all outputs are named 'OnSomethingHappened'. if ( string.Left( k, 2 ) == "On" ) then self:StoreOutput( k, v ) end end