i have a couple scripts in my game just for developer products, and sometimes it acts up and doesnt execute the right script after i purchase the dev product?
example: (random scenario) i would click a donate button, i would be prompted with the donation devproduct but when i press purchase it gives myself 200 coins (which would be another script)
script 1:
local gui = script.Parent.Parent.Parent.Parent.Parent.prompt
local id = 1132359762
script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, id)
wait(3)
gui:TweenPosition(UDim2.new(0.914, 0, 0.106, 0))
wait(1)
gui:TweenPosition(UDim2.new(1.1, 0, 0.106, 0))
end)
(i dont have a server script for this, as its just a donation, but when i press the button,
script two executes
local function processReceipt(receiptInfo)
local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then
-- blah blah
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt
script two is a server script, and is activated by a button in workspace
the prompt:
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local productID = 1119127385
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
MarketplaceService:PromptProductPurchase(player, productID)
print("User " .. player.Name .. " prompted to purchase ignite")
end)
its usually broken both ways, sometimes i’d click the brick and purchase the right devproduct, but i’d receive the wrong thing
and if i click the gui for the donation thing, it would activate script 2
sometimes it works, and most times it doesnt.
any help would be appreciated