Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Developer Product multi awarding?

Asked by
lomo0987 250 Moderation Voter
10 years ago

the script will award but it won't award the correct amount after the first time you buy the same Developer Product. It's like if you buy it and it will award you 2 points, and you keep buying it it will look like this.. First - 2 Second - 4 Third - 6 Fourth - 8 And so on. it keeps going up like that. I don't know why it keeps happening. I believe it has to do with 'pointsToAward' But I don't see how it keeps doing this.

Edit: It should only be awarding 2 each time they buy it, not how it is above.


local function buyItem(button) button.MouseButton1Click:connect(function() local marketId = button["market"].Value local pointsToAward = button["points"].Value link:PromptProductPurchase(plr,marketId) link.ProcessReceipt = function(receiptInfo) if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then stat.Value = stat.Value + pointsToAward end end end) end

2 answers

Log in to vote
0
Answered by 10 years ago

I would use a MarketplaceService instead of this, I can provide you the script, once I fixed it and if you want it.

Ad
Log in to vote
-1
Answered by 10 years ago

You never turned the stat.Value to 0 to restart it. You always kept adding 2 on and on.

0
stat.Value is their leaderstats.. If I changed that to 0, they would be mad. What the script keeps doing is keep rewarding them over and over again, I would need a way to delete the receiptInfo after it gave them the Currency... lomo0987 250 — 10y
0
Then turn the info to a var then reset it each time. RolandStudio 115 — 10y

Answer this question