wait(1) print("FOUND IT") if game.Players.LocalPlayer.leaderstats.Hunger.Value <= 10 then e = true print("1234") while e do wait(2) print("UGH") game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.Health - 10 end end --[[if player.Character.Humanoid.Health <= 0 then e = false --]]
all this does is print found it. i changed my leaderstats hunger value to 1, and it didnt do anything. i've tried this in both server script and local script. lines 13-15 are in comments because i wanted to handle one problem at a time.
It's because it will only run the code once, so it will only do everything you said once. You can put it in a loop so it checks "Hunger" more than just once but forever! Like this:
wait(1) print("FOUND IT") while wait(1) do -- the 1 can be changed to anything, it is how much it waits to repeat the loop in seconds, 1 would mean it would do this every second. if game.Players.LocalPlayer.leaderstats.Hunger.Value <= 10 then e = true print("1234") while e do wait(2) print("UGH") game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.Health - 10 end end end --[[if player.Character.Humanoid.Health <= 0 then e = false --]]