Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My HungerGUI won't deplete with this LocalScript?

Asked by 6 years ago
Edited 6 years ago
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







0
click on code block "the lua logo" above your qestion. it will print a bunch of "~~~~~~~~" put your code in between wookey12 174 — 6y

1 answer

Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
6 years ago

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.

0
Thanks for the advice! basicecstasy 122 — 6y
Ad

Answer this question