You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Just a hunger system or smth
-
What is the issue? The number value wont change (no errors popping up on the console)
-
What solutions have you tried so far? i tried changing some variables
game.Players.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local hunger:NumberValue = plr:WaitForChild("Hunger")
while task.wait(1) do
if hunger.Value >= .1 then
hunger.Value -= .1
else
char:WaitForChild("Humanoid").Health -= 5
end
end
plr.CharacterAdded:Connect(function(chr)
hunger.Value = 100
end)
end)