ENT.Use
From GMod Wiki
Event Hook | |
Hook Name | Use |
Syntax | ENT:Use( Entity activator, Entity caller[, Integer use_type β, Integer value β] ) |
Description | Called when the a player presses the 'Use' key on the SENT. |
Returns | Nil |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=ENT.Use]ENT.Use [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Info
- The use key is the identifier of who activated the entity.
- This function will be called as long as you keep holding down the USE key on the entity.
- To modify this behavior, use Entity:SetUseType along with the *_USE enumerations like SIMPLE_USE (Just calls this function one time once you pressed USE on it).
- Use_type specifies purpose of usage of the entity and is set by activator. It can be set to the following values:
SHARED | 0000000000000000 | 00000000000000000 | USE_OFF SHARED | 0000000000000001 | 00000000000000001 | USE_ON SHARED | 0000000000000002 | 00000000000000010 | USE_SET SHARED | 0000000000000003 | 00000000000000011 | USE_TOGGLE