so my hunger system works but the bar in the gui dosnt go down pretty sure its because of the value changed event and ive even made a new variable for it but that didnt work heres the error
Players.Roastdbacon.PlayerGui.PlayersHud.Hunger.Meter.LocalScript:8: attempt to index number with 'Changed'
local frame = script.Parent
local character = game:GetService("Players").LocalPlayer.character
local player = game.Players.LocalPlayer
local human = player.character:WaitForChild("Humanoid")
local hunger = player.NonPvPStats:WaitForChild("Hunger")
local hungerValue = hunger.Value
hungerValue.Changed:Connect(function()
frame:TweenSize(UDim2.new(0,hunger.Value / 100,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Sine)
end)
while true do
if hunger.Value == 0 then
--stops play from sprinting
--reduces players regen
wait(5)
else
hunger.Value = hunger.Value - 1
wait(5)
end
end