Number value getting substracted more than it should be

Hello developers of Roblox,

I am having an issue with one of my scripts where a value is getting substracted always to -2, even with a higher value.
I have tried to fix it multiple times but it did not fix my problem.

Local Script:
image

Server Script:
image

Thanks if anyone is able to help me with this.

More info:

No matter what the price is, the negative number will always add 2 to the negative. So when you get -2 from one purchase, you get -4 from the next, even if the price stays the same. Also yes, it is a shop system, sorry for not telling that eariler.

I managed to fix it by making the value (on the server) nil and making all the calculations on the client.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.