Powerload
Based on game build 714014 | Last updated: 2026-03-03
Overview
Powerload is a simple utility component that tracks a numeric load value (defaulting to 1) and a boolean isidle flag. It provides methods to read, update, and inspect these values. It is designed to be lightweight and is typically attached to entities requiring power-level tracking.
Usage example
local inst = CreateEntity()
inst:AddComponent("powerload")
inst.components.powerload:SetLoad(0.75, true)
print(inst.components.powerload:GetLoad()) -- 0.75
print(inst.components.powerload:IsIdle()) -- true
Dependencies & tags
Components used: None identified
Tags: None identified
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
load | number | 1 | Current power load value. |
isidle | boolean | false | Whether the power load is idle. |
Main functions
SetLoad(_load, idle)
- Description: Updates the power load value and optionally sets the idle state.
- Parameters:
_load(number) — the new power load value.idle(boolean, optional) — iftrue, marks the load as idle; defaults tofalseif omitted or nottrue.
- Returns: Nothing.
GetLoad()
- Description: Returns the current power load value.
- Parameters: None.
- Returns:
number— the storedloadvalue.
IsIdle()
- Description: Returns whether the power load is currently marked as idle.
- Parameters: None.
- Returns:
boolean—trueifisidleis set; otherwisefalse.
Events & listeners
None identified