Change Name of Points Leaderstat

Hello,

Recently i thought about changing the name of one of my games currency from “Points” to “Coins”.
I tried doing this which worked, but then my shop system started glitching out while i changed nothing about it.


This image shows where the leaderstats originate from. (Where i changed the name from “Points” to “Coins” as you can see in the middle.


And in this image you can see part of the script (from shop gui) that determines the currency.

The exact problem that the shop gui has gotten due to this is that whenever someone buys a gear, the leaderstats aren’t taken off of the players balance until they rejoin. Which means they can keep buying everything that isn’t higher than the amount of currency they have without losing balance, leading to their balance going below 0 when they rejoin.

Is there anyone that knows whats causing this problem?

Just put .Name on it? What’s so hard

If you changed the name of your currency from “Points” to “Coins”, you must remove the “Points” string and replace it with “Coins” in every scripts that interacts with your player’s leaderstats.

1 Like

So every pointsValue has to change to coinsValue right?

Not the variable. As an example, on your second screenshot, you must replace local pointsValue = leaderstats:FindFirstChild("Points") to local pointsValue = leaderstats:FindFirstChild("Coins").

(After thinking twice, if you already have a coinsValue variable that is set to leaderstats:FindFirstChild(“Coins”) then you can just change the pointsValue variable with coinsValue, otherwise you can do my method or create a new coinsValue variable and so as said above)

Thanks for helping! It worked!

1 Like