Hello! I’ve decided to release a set of resources that I am currently working on as a replacement for ESX’s native status system. I feel that this warrants a “why?” - please refer to the motivation section.
This system is composed of three resources:
- pc-needs : The underlying status system
- pc-hud : A HUD for the status system
- pc-consumables : Useable item register for consumable items
Motivation
This resource was made to replace ESX’s native status resources (namely esx_basicneeds, esx_optionalneeds, esx_status, and esx_hud) with a configurable status system. Currently ESX’s provided system is predominantly client-sided whereas this status system operates predominantly on the server and syncs its state with the database.
This is intended to be used with pc-hud and pc-consumables, however, they can be easily be omitted / replaced with some scripting knowledge.
Moving the system to the server allows for:
- More security / forced server side validation
- Flexible durations (that either persist or do not persist across disconnects / reboots)
- Interactable stats that do not need to share their state with clients
Features
Traditional needs
This system supports basic needs that are subject to a time decay (like hunger and thirst) while a player is connected.
Temporary effects
Exports can add temporary or permanent buffs / enfeeblements to players that expire in real time as opposed to tick timing while a player is connected.
RPG / Reputation traits
With this system, you may create and modify relatively static status types that act like traditional RPG traits like strength, intelligence, etc. These kinds of traits also allow for a reputation-style status type.
Skill checks
Exports can be used to make rolls against RPG / reputation-like status types with three levels of difficulty.
Player augmentations
This resource comes with the following augmentations that can trigger based off of status type set up:
- Player speed (caffeine)
- Acid effect
- Drunk effect (plus 5% chance of random outbursts, see config.lua)
- High effect (thc)
- Death / overdose
Preview
In this preview, I am using a separate script to remove the minimap health and armor bars based on this thread - this is not the doing of pc-hud. Chat is cc-chat. Minimap here.
Drawbacks
Effect ticks use SQL to correctly store and calculate expiration state. As such, having a large player base alongside a high latency connection to your db may cause server performance issues.
Dependencies
This resource is intended to be used in tandem with pc-consumables / pc-hud in an ox_inventory environment, but you could easily omit pc-consumables or replace pc-hud.
Additionally, you will need ESX. There is also a dependency on rpemotes if you decide to utilize pc-consumables.
Additional credit
pc-hud is my first TypeScript / React project. As such, I heavily referenced (and directly copied with proper licensing / attribution some of) the build and utility scripts used in the graphical components of ox_inventory. I give credit to Linden, Dunak, Luke, and the other contributors of ox_inventory for this.
If you feel that I have not properly credited, or honored the license of, the contributors of ox_inventory then let me know so that I can properly do so.
Exports & Events
Exports and an event are provided so that developers may replace pc-hud as I may no longer make releases for it. Please refer to the GitHub read me for documentation.
All player augmentations are enforced via client events. See client.lua for more information.
License
This resource is licensed under the MIT License - feel free to do as you desire with it so long as the terms of the license are met.