So i made a dev product (UI) but i can't get "ProcessReceipt" in a local script so i so i used a remote event but it says
"Receipt info a nil value" (in regular script)
and i don't know how to fix it
script in workspace (regular) btw. code: (script in worksace) V
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()
local market = game:GetService("MarketplaceService")
function market:ProcessReceipt(ReceiptInfo)
local player = game.Players:GetPlayerByUserId(ReceiptInfo.PlayerId)
if ReceiptInfo.ProductId == 12345 then
player.Character.Humanoid.WalkSpeed = 50
end
end
end)
local script under text button (remote event in ReplicatedStorage) btw.
local Player = game.Players.LocalPlayer
local id = 12345
local market = game:GetService("MarketplaceService")
local rem = game.ReplicatedStorage.RemoteEvent
script.parent.TextButton.MouseButton1Click:Connect(function()
market:PromptProductPurchase(Player,id)
game.ReplicatedStorage.RemoteEvent:FireServer()
end)

2 comments
Why on earth are you making a method of the same name as the MarketplaceService's callback? That literally makes no sense.
It's just odd to assign to a service's property; this is the only time I know of where it's the correct api use. Pretty sure this syntax is valid unless it's expecting no self internally.