mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 11:01:25 +00:00
refactor(client/main): Use pairs loop
This commit is contained in:
+3
-3
@@ -58,14 +58,14 @@ AddEventHandler('esx_status:onTick', function(data)
|
||||
local prevHealth = GetEntityHealth(playerPed)
|
||||
local health = prevHealth
|
||||
|
||||
for i=1, #data do
|
||||
if data[i].name == 'hunger' and data[i].percent == 0 then
|
||||
for k, v in pairs(data) do
|
||||
if v.name == 'hunger' and v.percent == 0 then
|
||||
if prevHealth <= 150 then
|
||||
health = health - 5
|
||||
else
|
||||
health = health - 1
|
||||
end
|
||||
elseif data[i].name == 'thirst' and data[i].percent == 0 then
|
||||
elseif v.name == 'thirst' and v.percent == 0 then
|
||||
if prevHealth <= 150 then
|
||||
health = health - 5
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user