This error occurs immediately whenever I start my game.
Code:
Error:
Thanks to any who can help. The script is located inside of ServerScriptService. If you need anymore info, just ask.
Thank in advance!
This error occurs immediately whenever I start my game.
Code:
Error:
Thanks to any who can help. The script is located inside of ServerScriptService. If you need anymore info, just ask.
Thank in advance!
Remove the ()
at the end of the last line, you’re firing the function isntead of setting it as the callback.
Line 22 should be
Market.ProcessReceipt = processReceipt
local marketPlace = game:GetService("MarketplaceService")
local productID = 2307902157
marketPlace.ProcessReceipt = function(receiptInfo)
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
if receiptInfo.ProductId == productID then
player.leaderstats.Gold.Value += 100
print(player.Name .. " just purchased a devproduct")
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
Okay @EmbatTheHybrid, I’ll check it out. The DevProduct itself is acting up now, but i will definitely try what you said.
Well, now this is showing up.
Hooray. Does anyone know what this is?
local Market = game:GetService('MarketplaceService')
local productId = 2307902157
local function promptPurchase()
local player = game.Players.LocalPlayer
-- ask player if they want to buy devproduct
Market:PromptProductPurchase(player, productId)
end
script.Parent.MouseButton1Click:Connect(promptPurchase)
This is the local code.
What’s the item you’re trying to prompt?
100 Gold, at the top of the screenshot.
Did you remember to enable Third-Party sales? And are you using the right id? Check both of those out
is that id correct???
The id was incorrect - thanks so much!
Beginner mistakes .