In my game, the player is able to purchase in-game currency through DevProducts. After making a script to do so it doesn’t give the player the rewards they purchase, in this case, Money, they are prompted with the ability to purchase the DevProduct, but after buying it nothing is given. In the video, I purchased the +1000 Money DevProduct but as you can see I didn’t receive anything.
I have looked for solutions on the DevForum but none seem to work, I have also tried to follow several tutorials although none of them seem to work either.
AddToItem is a pointer. All your code does is add 1000 to this variable. To change the amount of money the player has, you need to reference the specific Instance you are changing again.
Change that line to game.Players.LocalPlayer.leaderstats[CurrencyName].Value += 1000
I implemented this, although it can not identify “leaderstats” which is the Parent for the IntValue “Money” which is what I am trying to add to. I have tried both;
Line 6 ~ local CurrencyName = “Money”
Line 20 ~ game.Players.LocalPlayer.leaderstats[CurrencyName].Value += 1000
and
(No variable)
Line 20 ~ game.Players.LocalPlayer.leaderstats[“Money”].Value += 1000
This image has the output error in which only occurs when the Player is prompted to purchase the Product and presses “Buy Now”. Nothing is given still, I believe it is because of this problem.