Battery system
The Quasar Smartphone features an advanced battery system managed through intelligent JSON storage, which tracks each player's battery status. Here's a simple explanation of its functionalities and usage.
Battery usage settings
Ensure Config.EnableBattery is enabled in your config.lua, or the battery system won't work. You can customize the battery usage for each app and adjust overall consumption using Config.Battery. This allows you to control how quickly the battery drains for different applications.
Recharging options
Administrator battery command
Admins can recharge players' batteries using a dedicated command. Enable Config.AdminCommand in config.lua to manage permissions and commands. The default command is /adminbattery id amount to set a player's battery level.
Checking battery level
Use the export getBattery to check a player's battery level from the client side. This is a simple and efficient way to create custom events that rely on battery status.
This system is flexible, allowing full customization of battery usage, charging methods, and administrative controls.
Last updated