State Bags
Global and player state used by Possible Turfs.
The resource folder on your server must be named exactly possible_turfs.
Quick reference
| State bag | Scope | Type | Set by | Description |
|---|---|---|---|---|
turf:{zoneName} | Global | table | Server | Ownership, bomb, cooldown timers |
inTurfZone | Player | string / nil | Client | Current turf zone name |
canEmote | Player | boolean | Client | Emotes allowed (false inside a turf) |
turf:{zoneName}
Example key: turf:Kortz Center
| Property | Type | Description |
|---|---|---|
isBombPlanted | boolean | Bomb currently active |
plantingGang | string / nil | Gang that planted |
exploded | boolean | Bomb has exploded |
owner | string / nil | Owning gang |
bombExpiresAt | number / nil | Unix time bomb detonates |
cooldownExpiresAt | number / nil | Unix time cooldown ends |
local state = GlobalState['turf:Kortz Center']if state then print(state.owner, state.isBombPlanted, state.bombExpiresAt)end
AddStateBagChangeHandler('turf:Kortz Center', 'global', function(bagName, key, value) if value then print('Turf updated', value.owner, value.isBombPlanted) endend)For a ready-made status table (including remaining seconds), use the exports.
inTurfZone
Set to the zone name on enter, cleared to nil on exit.
local zone = LocalPlayer.state.inTurfZoneif zone then print('In turf:', zone)endcanEmote
Set to false when entering a turf, true when leaving. Use this if your emote menu should block in red zones.
if LocalPlayer.state.canEmote == false then return -- blockedend