I am setting up a monetization system in my game, with a shop gui and stuff, and I want to make it be announced when a player buys one of the items in the shop to the whole server through a text UI being created.
Basically its like this:
-Player buys product
-Announcement is displayed, "(Player) has bought (product)" for about 5 seconds
So far I just have the purchase prompt, so what do I add to it?
local devproduct = 1002728743 --Change id to devproduct
local player = game.Players.LocalPlayer
local service = game:GetService("MarketplaceService")
script.Parent.MouseButton1Down:Connect(function()
service:PromptProductPurchase(player, 1002728743) -- Change id to devproduct
end)

1 comment
Note that this is a server script that you can put in ServerScriptService. Learn more about MarketplaceService.ProcessReceipt: https://developer.roblox.com/en-us/api-reference/callback/MarketplaceService/ProcessReceipt