> For the complete documentation index, see [llms.txt](https://docs.vames-store.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vames-store.com/assets/vms_hud/configuration-files/config.server.lua.md).

# config.server.lua

Preview File Updated: v1.1.4 - 20/02/2024

{% code lineNumbers="true" fullWidth="true" %}

```lua
if Config.Core == "ESX" then
    ESX = Config.CoreExport()

    RegisterNetEvent('vms_hud:addStress', function(amount)
        local src = source

        if Config.UseVMSNeeds then
            exports['vms_needs']:AddStatus(src, 'stress', amount)
        else
            TriggerClientEvent('esx_status:add', src, 'stress', amount)
        end
    end)

    RegisterNetEvent('vms_hud:removeStress', function(amount)
        local src = source

        if Config.UseVMSNeeds then
            exports['vms_needs']:RemoveStatus(src, 'stress', amount)
        else
            TriggerClientEvent('esx_status:remove', src, 'stress', amount)
        end
    end)
    
elseif Config.Core == "QB-Core" then
    QBCore = Config.CoreExport()

    RegisterNetEvent('vms_hud:addStress', function(amount)
        local src = source
        local Player = QBCore.Functions.GetPlayer(src)

        if Config.UseVMSNeeds then
            exports['vms_needs']:AddStatus(src, 'stress', amount)
            return
        end
        
        local newStress
        if not Player.PlayerData.metadata['stress'] then
            Player.PlayerData.metadata['stress'] = 0
        end
        newStress = Player.PlayerData.metadata['stress'] + amount
        if newStress <= 0 then 
            newStress = 0 
        end
        if newStress > 100 then
            newStress = 100
        end
        Player.Functions.SetMetaData('stress', newStress)
        TriggerClientEvent('hud:client:UpdateStress', src, newStress)
    end)

    RegisterNetEvent('vms_hud:removeStress', function(amount)
        local src = source
        local Player = QBCore.Functions.GetPlayer(src)

        if Config.UseVMSNeeds then
            exports['vms_needs']:RemoveStatus(src, 'stress', amount)
            return
        end
        
        local newStress
        if not Player then return end
        if not Player.PlayerData.metadata['stress'] then
            Player.PlayerData.metadata['stress'] = 0
        end
        newStress = Player.PlayerData.metadata['stress'] - amount
        if newStress <= 0 then newStress = 0 end
        if newStress > 100 then
            newStress = 100
        end
        Player.Functions.SetMetaData('stress', newStress)
        TriggerClientEvent('hud:client:UpdateStress', src, newStress)
    end)
end

AddEventHandler("mumble:SetVoiceData", function(key, value)
    if key == 'mode' and value then
        TriggerClientEvent('mumble-voip:setHudMode', source, tonumber(value))
    end
end)
```

{% endcode %}
