Page 1 of 1

Exposing a getter/setter for player energy

Posted: Mon Jan 13, 2020 12:31 am
by JakSparro98
Today we can access player's health by invoking it's inherited method from IObject, however currently is not possible to manipulate/read the stamina/energy value, pretty weird it wasn't planned in any way, am I missing something?

Re: Exposing a getter/setter for player energy

Posted: Sat Jan 18, 2020 11:30 pm
by Gurt
You can only activate infinite energy using modifiers per player or use the global /ie 1 command.
You can not update the stamina value as that wouldn't reliably be predictable by the client, causing a lot of problems. If there's not a getter for the stamina already I will try to add one for the next update.
Edit: ScriptAPI: Added IPlayer.GetEnergy(), IPlayer.GetMaxEnergy() to read current energy from a player (v.1.3.4)