Type Tool
Tool
Methods
| getMode() | Returns the name of the mode associated with the tool object. |
| getOptions() | Returns the current options for the tool. |
| getPlayer() | Returns the player that owns the tool object. |
| isConfigurable() | Returns true if the tool can be confgiured using the setOptions() method. |
| isValid() | Returns true if this tool object is valid for use, false otherwise. |
| setOptions( options ) | Passes the given options table to the tool. |
Methods
- Tool:getMode()
-
Returns the name of the mode associated with the tool object.
Environment:
Shared - Tool:getOptions()
-
Returns the current options for the tool. The exact format of the options depends on the tool mode. Note that the returned data may not immediately reflect changes made by setOptions() due to the use of networked convar values.
Environment:
SharedReturn values:
-
(table | nil)The current options for the tool, or nil if they cannot be retrieved. -
(string)If the tool options are nil, the reason why.
-
- Tool:getPlayer()
-
Returns the player that owns the tool object.
Environment:
Shared - Tool:isConfigurable()
-
Returns true if the tool can be confgiured using the setOptions() method.
Environment:
Shared - Tool:isValid()
-
Returns true if this tool object is valid for use, false otherwise.
Environment:
Shared - Tool:setOptions( options )
-
Passes the given options table to the tool. The exact format of the options depends on the tool mode.
Environment:
SharedParameters:
-
(table) options: The options to pass to the tool.
Return values:
-
(boolean)True if the tool accepted the options and applied them, false if the options were rejected. -
(string)If the options were rejected, the reason why.
-