local hungerGui = script.Parent
local player = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
maxHunger = Instance.new("IntValue")
maxHunger.Name = "maxHunger"
maxHunger.Value = 300
maxHunger.Parent = game.Players.LocalPlayer
currHunger = Instance.new("IntValue")
currHunger.Name = "currHunger"
currHunger.Value = 300
currHunger.Parent = game.Players.LocalPlayer
minHunger = Instance.new("IntValue")
minHunger.Name = "minHunger"
minHunger.Value = 0
minHunger.Parent = game.Players.LocalPlayer
while true do
wait(10)
currHunger.Value = currHunger.Value - 15
if currHunger.Value > maxHunger then
currHunger.Value = 300
print("Fixed Max Health")
end
if currHunger.Value <= minHunger then
player.Health = 0
print("You've Died From Hunger")
end
script.Parent.Percentage.Text = math.floor(game.Players.LocalPlayer.Character:WaitForChild(currHunger))
end
✓ ANSWER ACCEPTED
My HungerGUI won't deplete with this LocalScript?
1 answer
✓ Accepted answer
We cant answer this, don't bother posting unless you can say 'The hunger bar will not deplete' or 'I get an error when trying to modify hunger' The big issue i can see, is it's a LOCAL SCRIPT. If you dont use a server script too, and turn fe on, your gonna have big exploiters.
1 comment
0
Thanks for the advice!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
click on code block "the lua logo" above your qestion. it will print a bunch of "~~~~~~~~" put your code in between