Okay so I am making a game with my friend, he does building, I script, I ran into an error that I need to fix or it might pause gameplay and ruin the game I will tell problem after code:
while true do wait(5) script.wt.Value = script.wt.Value - 2 if script.wt.Value <= 0 then script.wt.Value = 0 game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPLayer.Character.Humanoid.Health - 10 elseif script.wt.Value == 40 then --This is only because I tried to fix it, this was not originally here wait(5) script.wt.Value = script.wt.Value - 2 end end
Okay so after it gets down to 0, I drink water (I made it make water level go up) It goes up to 40, which is where I want it to go, but it doesn't go down. (More info) wt is a NumberValue, set to 100, it goes down 2 every five seconds, it is located in the script If more info is required please tell me