local Players = game:GetService("Players") local MarketplaceService = game:GetService("MarketplaceService") local PurchaseHistory = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory") function onPlayerPurchased (player) game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{ Text = ".. player.Name .. " has bought "receiptInfo.PlayerId .. ":" .. receiptInfo.PurchaseId. if PurchaseHistory:GetAsync(playerProductKey) then return Enum.ProductPurchaseDecision.PurchaseGranted end Color = Color3.new(255,255,255); Font = Enum.Font.SourceSansBold; FontSize = Enum.FontSize.Size18; }) end local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId) if not player then return Enum.ProductPurchaseDecision.NotProcessedYet end PurchaseHistory:SetAsync(playerProductKey, true) return Enum.ProductPurchaseDecision.PurchaseGranted end end
As a Local script in StarterGUI.