Garry's Mod Wiki

Entity:Fire

Entity:Fire( string input, string param, number delay = 0 )

Description

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

See also Entity:Input for a function that bypasses the event queue and GM:AcceptInput.

Arguments

1 string input
The name of the input to fire
2 string param
The value to give to the input, can also be a number or a boolean.
3 number delay = 0
Delay in seconds before firing

Example

If you are looking at a door, this will lock it

// 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

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 5
Generate Html 7
SaveChanges (1) 14
Render Body 0
Render Sidebar 5