Alright, So I'm trying to get this script to add points to a leaderboard but how do I confirm that they bought the item and how do I add to the leaderboard?
local Id = script.Parent.ID.Value local player = game.Players.LocalPlayer function onClick() Game:GetService("MarketplaceService"):PromptPurchase(player, script.Parent.ID.Value, false, 0) end script.Parent.MouseButton1Click:connect(onClick)
You can use the PromptPurchasedFinished
event.
Server script:
Game:GetService("MarketplaceService").PromptPurchaseFinished:connect( function(Player,Id,Purchased) if Purchased then if Id == 3 then --Do stuff Player.Character:BreakJoints() elseif Id == 32 then --Stuff end end end)