📃 last-energy introduces a fully featured, persistent energy management system, designed for survival, technical RP, and post-apocalyptic FiveM servers.
It provides a complete framework for energy production, storage, and distribution, based on placeable world props, ownership rules, crew permissions, wear, and realistic interactions.
This script should be used with a blackout resource for optimal performance.
Generator Features
Placeable generators: freely deployable in the world using a placement editor.
On / Off system with persistent state.
Generator locking: owners can lock generators; other players may force them open using a lockpick (ox_lib minigame).
Repair system: generators degrade over time and require repairs through a dedicated UI.
Access control:
Owner → full access
Crew members → full access
Non-owners → open generator or force lock only (if locked)
Energy Production Components
Solar panels: generate energy based on weather conditions.
Wind turbines: energy output influenced by wind/weather.
Dynamic connections: components can be linked or disconnected from generators.
Full persistence: position, state, and connections are stored in the database.
Lighting System
Placeable lights (bulbs) connected to generators.
Toggle on/off interaction available when permitted.
Advanced management (owner / crew):
Dismantle
Reposition
Disconnect from generator
Real energy consumption based on available stored power.
Interactions & Permissions
Owner: all interactions available
Crew members: full access, same as owner   -- COMING SOON
Non-owners:
Generators → Open / Force lock
Lights → Toggle on/off
Dynamic targeting system powered by
ox_target or qb-target
Dependencies
ox_libox_targetox_inventory, qb-inventory, core_inventory, minventory (CODEM)oxmysqllast-crew (optional) -- SOON AVAIBLEqbx_core,qb-core,es_extended