So, I'm working on an obby and I'm trying to make a skip stage GUI. But I searched it up on google and the model I got didn't work... I don't want to add teams, though. Here is the script I tried:
local productId = 47185810 -- Change to the ID of your developer product.
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player, productId)
end)
That script was in the GUI.
stat = "Stage" -- Change to the stat's name.
award = 1 -- Change to the ammount of stat to award.
MarketplaceService = Game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
players = game.Players:GetPlayers()
for i=1,#players do
if players[i].userId == receiptInfo.PlayerId then
players[i].leaderstats[stat].Value = players[i].leaderstats[stat].Value+award
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
This was in the serverscriptservice.

1 comment
lol