Entity::getOwnVariable: Difference between revisions
KirillZver (talk | contribs) No edit summary |
MrPancakers2 (talk | contribs) m (Undone translations) |
||
| Line 4: | Line 4: | ||
Allows to get the value set with [[Entity::setOwnVariable|entity.setOwnVariable(key, value)]]. | Allows to get the value set with [[Entity::setOwnVariable|entity.setOwnVariable(key, value)]]. | ||
{{JSContainer| | {{JSContainer| | ||
| Line 20: | Line 18: | ||
This will set the job id for this player, which will only be available to him. | This will set the job id for this player, which will only be available to him. | ||
{{ServersideCode| | {{ServersideCode| | ||
<pre> | <pre> | ||
| Line 30: | Line 27: | ||
So we get the value that we set earlier. | So we get the value that we set earlier. | ||
{{ServersideCode| | {{ServersideCode| | ||
<pre> | <pre> | ||
Revision as of 09:21, 4 January 2021
Server-Side Function
Allows to get the value set with entity.setOwnVariable(key, value).
JavaScript Syntax
Syntax
entity.getOwnVariable(key);
Required Arguments
- *entity: Object
- *key: String
Example
This will set the job id for this player, which will only be available to him.
Server-Side
player.setOwnVariable("jobId", 9);
So we get the value that we set earlier.
Server-Side
player.getOwnVariable("jobId"); // 9