Entity::getOwnVariable: Difference between revisions
MrPancakers2 (talk | contribs) m (Undone translations) |
No edit summary |
||
| Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
{{ServersideJsFunction}} | |||
{{JSContainer| | |||
Gets the value of the key set with [[Entity::setOwnVariable|player.setOwnVariable(key, value)]]. | |||
=== Required Params=== | |||
*{{Required}}'''key''': {{RageType|String}} | |||
==Syntax== | ==Syntax== | ||
<pre> | <pre> | ||
player.getOwnVariable(key); | |||
</pre> | </pre> | ||
==Example== | ==Example== | ||
Revision as of 18:41, 29 May 2024
Server-Side Function
JavaScript Syntax
Gets the value of the key set with player.setOwnVariable(key, value).
Required Params
- *key: String
Syntax
player.getOwnVariable(key);
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