Wax
Based on game build 714014 | Last updated: 2026-03-03
Overview
Wax is a simple component that manages the waxspray tag on an entity based on its is_spray state. It is typically attached to wax-related items to indicate whether they are currently in "spray" mode. The component provides a clear API to toggle and query this mode, automatically synchronizing the entity's tags.
Usage example
local inst = CreateEntity()
inst:AddComponent("wax")
-- Activate spray mode
inst.components.wax:SetIsSpray()
-- Check current mode
if inst.components.wax:GetIsSpray() then
-- Perform spray-specific logic
end
Dependencies & tags
Components used: None identified
Tags: Adds waxspray when is_spray is true; removes it when false.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
is_spray | boolean | false | Indicates whether the entity is acting as a wax spray. |
Main functions
SetIsSpray()
- Description: Sets the
is_spraystate totrueand adds thewaxspraytag to the entity. - Parameters: None.
- Returns: Nothing.
GetIsSpray()
- Description: Returns the current
is_spraystate. - Parameters: None.
- Returns:
boolean—trueif the entity is in spray mode,falseotherwise.
Events & listeners
- Listens to:
is_spray— an internal functionOnIsSprayFnis bound to this property name in the class metatable and triggers tag updates when the property is set. - Pushes: None identified