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

Won't go down after 0?

Asked by 8 years ago

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

0
Hold on let me fix the code block fireboltofdeath 635 — 8y
0
Seems a bit weird that a novice like me found that error. RadiantSolarium 35 — 8y
0
It is a spelling error. Not saying you are bad, unless you are being sarcastic then ignore what I said fireboltofdeath 635 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

Spelling error in line 06.

Ad

Answer this question