Subtracting from in variables only subtracts one, How do I fix this?
So, Im making a part that when I click it it subtracts one from a variable. The click detector should work until it hits 0, and I get no errors on this part and it works fine besides for when I click it to subtract.
01 | local clickdetector = game.Workspace [ "Forest Cavern" ] .PuzzleOne.ClickDetector |
06 | clickdetector.MouseClick:Connect( function () |
07 | local bricklife = bricklife - 1 |
Heres the code I have written. What happens is, the bricklife starts as ten, then I click it and the bricklife prints 9 in the output, but when I click it again it prints 9 again, and doesnt go down. I clicked it 20 times and it still printed nine, showing its not just something wrong with the print statement. How do I make it so it continually subtracts?