For the complete documentation index, see llms.txt. This page is also available as Markdown.
Installation
1. Download Resource
Download the purchased resource from CFX Portal - the official site of FiveM with purchased resources.
2. Import Database Tables
This is a very important step - without it, the script will not work properly.
Depending on the framework you are using (ESX or QB-Core), select the appropriate section below and paste the SQL code into your database.
Not sure how to do it?
No worries - we've prepared a short guide that shows you step by step how to import an SQL file into your database:
👉 Click here to view the tutorial.
Database for ESX
ALTERTABLE`users`ADD COLUMN IFNOTEXISTS`status` longtext DEFAULTNULL;CREATETABLEIFNOTEXISTS`needs` (`id`int(11) NOT NULL AUTO_INCREMENT,`item`varchar(50) NOT NULL,`model`varchar(50) NOT NULL,`position` longtext NOT NULL,`bucket`int(11) DEFAULT0,`metadata` longtext DEFAULTNULL,`createdAt`bigint(20) DEFAULTNULL,`createdBy`varchar(100) DEFAULTNULL,PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=1DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
Database for QB-Core
ALTERTABLE`players`ADD COLUMN IFNOTEXISTS`status` longtext DEFAULTNULL;CREATETABLEIFNOTEXISTS`needs` (`id`int(11) NOT NULL AUTO_INCREMENT,`item`varchar(50) NOT NULL,`model`varchar(50) NOT NULL,`position` longtext NOT NULL,`bucket`int(11) DEFAULT0,`metadata` longtext DEFAULTNULL,`createdAt`bigint(20) DEFAULTNULL,`createdBy`varchar(100) DEFAULTNULL,PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=1DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
3. Add Items
The script uses its own items.
Depending on what inventory you are using, select the appropriate section and add these items to either your item file or database.
Items for ox_inventoryItems for qb-inventory / origen_inventory
4. Remove Conflicting Resources
Before starting VMS Needs, make sure to remove or disable any resources that provide the same functionality.
Running multiple needs/status systems at the same time may cause conflicts, duplicated effects, or unexpected behavior.
Common resources that should be removed:
esx_status
esx_basicneeds
qb-smallresources(consumables.lua file)
Any custom hunger / thirst / stress / needs system
Any standalone consumables resource that modifies player needs
⚠️ Additional Step for qb-core (Required)
You must remove the built-in hunger/thirst handling from qb-core to prevent conflicts with VMS Needs.
Remove the following code from: qb-core/client/loops.lua
⚠️ Additional Step for qbx_core (Required)
You must remove the built-in hunger/thirst handling from qbx_core to prevent conflicts with VMS Needs.
Remove the following code from: qbx_core/client/loops.lua
Remove the following code from: qbx_core/server/loops.lua
Important:
VMS Needs is designed to fully replace these systems. Running them together is not supported.
6. Start Resource
To start a resource in your server.cfg, ensure that it begins after your framework has been initiated. For instance, if you are using a framework like es_extended, you should start resource after it, like so:
Ensure there are no syntax errors or incorrect paths in your server.cfg.
CreateThread(function()
while true do
if LocalPlayer.state.isLoggedIn then
if (QBCore.PlayerData.metadata['hunger'] <= 0 or QBCore.PlayerData.metadata['thirst'] <= 0) and not (QBCore.PlayerData.metadata['isdead'] or QBCore.PlayerData.metadata['inlaststand']) then
local ped = PlayerPedId()
local currentHealth = GetEntityHealth(ped)
local decreaseThreshold = math.random(5, 10)
SetEntityHealth(ped, currentHealth - decreaseThreshold)
end
end
Wait(QBCore.Config.StatusInterval)
end
end)
CreateThread(function()
local timeout = 1000 * statusInterval
while true do
Wait(timeout)
if QBX.IsLoggedIn then
if ((playerState.hunger or 0) <= 0 or (playerState.thirst or 0) <= 0) and not playerState.isDead then
local currentHealth = GetEntityHealth(cache.ped)
local decreaseThreshold = math.random(5, 10)
SetEntityHealth(cache.ped, currentHealth - decreaseThreshold)
end
end
end
end)
local function removeHungerAndThirst(src, player)
local playerState = Player(src).state
if not playerState.isLoggedIn then return end
local newHunger = playerState.hunger - config.player.hungerRate
local newThirst = playerState.thirst - config.player.thirstRate
player.Functions.SetMetaData('thirst', newThirst)
player.Functions.SetMetaData('hunger', newHunger)
player.Functions.Save()
end
CreateThread(function()
local interval = 60000 * config.updateInterval
while true do
Wait(interval)
forEachPlayerStaggered(removeHungerAndThirst)
end
end)
start [core] # For example, here is your framework (esx/qb-core)
# Here you run your other resources like esx_policejob etc.
# VMS Resources
start vms_needs