I have more money than upgradeCost and says Not enough money

Hi, when i click a button working fine but i have more money than upgradeCost and this says in output i dosent have enoguh money i dont know if its bug or something please help

Are you updating player’s cash value on the server or on the client? If you’re updating it on the client, it may seem like the player is earning cash, but on the server, the true value is none (or 0), and therefore, would explain why it’s printing "Not enough cash!". Hope this helps!

3 Likes

Does the value of UpgradeCost change at all? Bc if so then any changes to the value won’t be read within the script since you set the ‘UpgradeCost’ to the initial value instead of re-reading the value within the RBXConnection. Otherwise, what @D4_rrk said may be a likely solution.

i changed upgradecost from replicated storage to server storage and seems to work

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