Entity::getVariable: Difference between revisions
GreenFanta (talk | contribs) (→Syntax) |
|||
| Line 9: | Line 9: | ||
==Example== | ==Example== | ||
{{ | {{Shared}} | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
// Supposed you want to get a vehicle you bound with a player | // Supposed you want to get a vehicle you bound with a player | ||
let veh = player.getVariable('veh'); | let veh = player.getVariable('veh'); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 22:21, 4 April 2018
Function: Gets a custom data from an entity.
Syntax
value entity.getVariable(name); // Returns null if key 'name' does not exist.
Example
Shared
// Supposed you want to get a vehicle you bound with a player
let veh = player.getVariable('veh');