Entity.Input
From GMod Wiki
Function | |
Syntax | Entity:Input( String input, Entity activator, Entity inflictor, Var param ) |
Description: | |
Similar to Entity:Fire, but you can make the entity think another entity is responsible! This triggers an input, for example, like a func_button's Press input. | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.Input]Entity.Input [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Makes the game think a certain player pressed a button. |
---|---|
Used on | |
Code | function makePlayerPressButton(Player,Button) Button:Input("Press",Player,Player) end |
Output | None |
Additional Notes
- Activator is an entity directly responsible, and inflictor is an entity indirectly responsible. For example if a thrown crate hits a player and triggers the OnHurt output, then the activator would be the crate and the inflictor would be the player who threw it. If you don't know what to use, use the same entity for the activator and the inflictor.
- Unlike Entity:Fire, this can only be used on the server.
- Param can be a String , Float , or Integer .
- Param is optional.