• Disable hunger for certain jobs
    2 replies, posted
Hello I would like to know if you have an idea to solve the problem of script because it does not work. I am looking to turn off hunger for certain jobs. I create a file sv _(...).lua then after I put it in sv modul darkrpmodification. But the code does not work hook.Remove("Think", "HMThink") local antihunter = {TEAM_AOD, TEAM_MOD, TEAM_TRUSTED} local function HMThink() if not GAMEMODE.Config.hungerspeed then return end for k, v in pairs(player.GetAll()) do if v:Alive() and (not v.LastHungerUpdate or CurTime() - v.LastHungerUpdate > 10) and ( not table.HasValue(antihunger, v:Team()) ) then v:hungerUpdate() end end end hook.Add("Think", "HMThink", HMThink)
UP
local noHungerTeams = { [TEAM_AOD] = true, [TEAM_MOD] = true, [TEAM_TRUSTED] = true, } hook.Add("hungerUpdate", "NoHunger", function(ply, en) if noHungerTeams[ply:Team()] then return true end end)
Sorry, you need to Log In to post a reply to this thread.