Update server.lua
This commit is contained in:
1 parent
943f86d47b
commit
aae3d540ff
1 file changed
+5
-5
@@ -252,9 +252,9 @@ end
|
|||||||
--- @param src number
|
--- @param src number
|
||||||
--- @return number | nil
|
--- @return number | nil
|
||||||
Framework.GetHunger = function(src)
|
Framework.GetHunger = function(src)
|
||||||
local status = Framework.GetStatus(src, "status")
|
local status = Framework.GetStatus(src, "hunger")
|
||||||
if not status then return nil end
|
if not status then return end
|
||||||
|
if type(status) ~= "table" then return end
|
||||||
for _, entry in ipairs(status) do
|
for _, entry in ipairs(status) do
|
||||||
if entry.name == "hunger" then
|
if entry.name == "hunger" then
|
||||||
return math.floor((entry.percent) + 0.5) or 0
|
return math.floor((entry.percent) + 0.5) or 0
|
||||||
@@ -266,9 +266,9 @@ end
|
|||||||
--- @param src any
|
--- @param src any
|
||||||
--- @return number | nil
|
--- @return number | nil
|
||||||
Framework.GetThirst = function(src)
|
Framework.GetThirst = function(src)
|
||||||
local status = Framework.GetStatus(src, "status")
|
local status = Framework.GetStatus(src, "thirst")
|
||||||
if not status then return nil end
|
if not status then return nil end
|
||||||
|
if type(status) ~= "table" then return end
|
||||||
for _, entry in ipairs(status) do
|
for _, entry in ipairs(status) do
|
||||||
if entry.name == "thirst" then
|
if entry.name == "thirst" then
|
||||||
return math.floor((entry.percent) + 0.5) or 0
|
return math.floor((entry.percent) + 0.5) or 0
|
||||||
|
|||||||
Reference in new issue
Block a user