For the complete documentation index, see llms.txt. This page is also available as Markdown.

qb-hud


1. Open the file

Open the following file: qb-hud/client.lua

2. Remove unnecessary code

Find the hud:client:UpdateNeeds event and delete the entire block RegisterNetEvent.

Find the hud:client:UpdateStress event and delete the entire block RegisterNetEvent.

3. Add status change listeners

Register both AddStateBagChangeHandler instances so that they can listen for status changes.

AddStateBagChangeHandler("hunger", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
    hunger = percentage
end)

AddStateBagChangeHandler("thirst", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
    thirst = percentage
end)

AddStateBagChangeHandler("stress", ("player:%s"):format(GetPlayerServerId(PlayerId())), function(_, _, percentage)
    stress = percentage
end)

Last updated