Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Won't go down after 0?

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

3 comments

0

Hold on let me fix the code block

0

Seems a bit weird that a novice like me found that error.

0

It is a spelling error. Not saying you are bad, unless you are being sarcastic then ignore what I said

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.