Jo guys! Im trying to make an script that sends a message in the chat after you bought a specific item with robux!
SCS:
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RELEASE_SHEEP_PRODUCT_ID = 3348688685
local releaseSheepEvent = ReplicatedStorage:FindFirstChild("ReleaseSheepPurchasedEvent")
MarketplaceService.ProcessReceipt = function(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == RELEASE_SHEEP_PRODUCT_ID then
if releaseSheepEvent then
releaseSheepEvent:FireClient(player)
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
SPS:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextChatService = game:GetService("TextChatService")
local releaseSheepEvent = ReplicatedStorage:WaitForChild("ReleaseSheepPurchasedEvent")
releaseSheepEvent.OnClientEvent:Connect(function()
local message = '<font color="rgb(50,255,0)">Du hast das Release Sheep gekauft!</font>'
TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage(message)
end)