Entity/Fire

From Garry's Mod
Jump to: navigation, search
 Entity:Fire( )

Contents

Description

Fires an entity's input. You can find inputs for most entities on the Valve Developer Wiki

See also Entity:Input and GM:AcceptInput.

Arguments

string input

The name of the input to fire

Arguments

string param=""

The value to give to the input, can also be a number or a boolean.

Arguments

number delay=0

Delay in seconds before firing

Examples

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


Personal tools
Navigation