I tryed to make a buy coins script but it takes the robux but does not add any coins to it.
The localscript:
--1235674804
local mps = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local id = 1238799050
script.Parent.MouseButton1Click:Connect(function()
mps:PromptProductPurchase(player, id)
end)
(this localscript is present in all 6 textbutton but with different ID)
The script inside serverscriptservice:
local mps = game:GetService("MarketplaceService")
--Buy coins ID for Thug
local ThugId = 1238799050
local ThugId2 = 1238799103
local ThugId3 = 1238799148
local ThugId4 = 1238799188
local ThugId5 = 1238799257
local ThugId6 = 1238799316
local function processReceipt(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then local Crowns = player.leaderstats.Crowns
if receiptInfo.ProductId == ThugId then
Crowns.Value += 100
end
if receiptInfo.ProductId == ThugId2 then
Crowns.Value += 200
end
if receiptInfo.ProductId == ThugId3 then
Crowns.Value += 300
end
if receiptInfo.ProductId == ThugId4 then
Crowns.Value += 500
end
if receiptInfo.ProductId == ThugId5 then
Crowns.Value += 1000
end
if receiptInfo.ProductId == ThugId6 then
Crowns.Value += 50000
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end
mps.ProcessReceipt = processReceipt
Thanks in advance for helping me