Its not so much a “is this correct because i can’t be bothered to test it thread” I just see alot of people asking how to disable hunger mod when theres not a cook so I thought I would give it a try and I knwo its not right.
Can someone lead me on the right tracks?
function ActivateMod ()
TEAM_COOK.NumPlayers return //Seems weird and not right
if TEAM_COOK.NumPlayers = 0
then DarkRP.disabledDefaults ["hungermod"] = false
else if TEAM_COOK.NumPlayers => 1
then DarkRP.disabledDefaults ["hungermod"] = true
//INSERT HOOK HERE
You forgot to edit this part of his code
[lua]if TEAM_COOK.NumPlayers = 0 then[/lua]
As you said it’s ==
[lua]if TEAM_COOK.NumPlayers == 0 then[/lua]
But you can do better (operators can be used after = ):
DarkRP.disabledDefaults.hungermod = TEAM_COOK.NumPlayers > 0