while true do
wait(10)
for i, player in pairs(game.Players:GetChildren()) do
local Hunger = player.NonPvPStats.Hunger
local Character = player.Character
local Human = Character.Humanoid
local Sprint = Character.Sprint
if Hunger.Value <= 0 then
Character.Health.Disabled = true
Sprint.Disabled = true
Human.Health = Human.Health - 5
wait(2)
elseif Hunger.Value > 0 then
Character.Health.Disabled = false
Sprint.Disabled = false
Hunger.Value = Hunger.Value - 2
wait(2)
end
end
end
ServerScriptService.Hunger:6: attempt to index nil with 'Humanoid'
i am thinking of adding waitforchild but that would just inf yield