Garry's Mod Wiki

Revision Difference

Entity:Fire#528406

<function name="Fire" parent="Entity" type="classfunc"> <description> Fires an entity's input. You can find inputs for most entities on the [Valve Developer Wiki](https://developer.valvesoftware.com/wiki/Output) See also <page>Entity:Input</page> and <page>GM:AcceptInput</page>. Fires an entity's input, conforming to the map IO event queue system. You can find inputs for most entities on the [Valve Developer Wiki](https://developer.valvesoftware.com/wiki/Output) See also <page>Entity:Input</page> for a function that bypasses the event queue and <page>GM:AcceptInput</page>. </description> <realm>Server</realm> <args> <arg name="input" type="string">The name of the input to fire</arg> <arg name="param" type="string" default="">The value to give to the input, can also be a <page>number</page> or a <page>boolean</page>.</arg> <arg name="delay" type="number" default="0">Delay in seconds before firing</arg> </args> </function> <example> <description>If you are looking at a door, this will lock it</description> <code> // Entity(1) is considered a player in this example local tr = Entity( 1 ):GetEyeTrace() local ent = tr.Entity if IsValid( ent ) then ent:Fire("Lock") end </code> </example>