I made this script that tests if Cash (My IntValue) has a value of 10 or more and if so it subtracts 10, but the IntValue remains the same after joining the game and clicking the part. I know the error is the subtraction because I have some other unimportant parts in this script that run fine. I just can't figure out how to subtract from an IntValue?
Heres the script I made:
script.Parent.ClickDetector.MouseClick:connect(function()
local Cash = workspace.Cash.Value
if Cash >= 10 then
Cash = -10
end)
if anybody could help me, I can't seem to figure out how to subtract from an IntValue.

1 comment
Thank a lot!