Skip to content

Commit

Permalink
Update server/consumables.lua
Browse files Browse the repository at this point in the history
Co-authored-by: lwhp <[email protected]>
  • Loading branch information
TonybynMp4 and lwhp authored Feb 16, 2024
1 parent 83f1fb1 commit d4fb458
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/consumables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ for alcohol, params in pairs(sharedConfig.consumables.alcohol) do

local sustenance = player.PlayerData.metadata.thirst + math.random(params.min, params.max)
player.Functions.SetMetaData('thirst', sustenance)
Player(source).state:set('alcohol', (Player(source).state.alcohol or 0) + params.alcoholLevel, true)
local playerState = Player(source).state
playerState:set('alcohol', (playerState.alcohol or 0) + params.alcoholLevel, true)

TriggerClientEvent('hud:client:UpdateNeeds', source, player.PlayerData.metadata.thirst, sustenance)
end)
Expand Down

0 comments on commit d4fb458

Please sign in to comment.