I am pretty sure its possible if the purchase was made in game, I might be wrong because I haven’t really worked with shirt purchases, but there are marketplace events that allow you to know if the purchase went through. I will get back to you shortly.
There is this event called “PromptPurchaseFinished”, you can use this to check if the player bought the shirt and then fireallclients using a remote event to show the servernotification to everyone.
local MarketPlaceService = game:GetService("MarketplaceService")
local ShirtID = 00000 -- put your shirt id here
MarketPlaceService.PromptPurchaseFinished:Connect(function(UserId,ProductId,IsPurchased)
if ProductId == ShirtID and IsPurchased then
local playerName = game.Players:GetPlayerByUserId(UserId).Name
NotificationEvent:FireAllClients(playerName)
end
end)
It’s pseudocode, @CelestialHonour made an example, not 100% working code. You’re going to have to build on his code to make your own, add RemoteEvents and so on.
Well, you have to define the event and work on the server notification code, I cannot help you with the whole thing. I did my best and showed you the path, you just gotta make remote events and work on the local script in gui.
Add RemoteEvent Called ‘PurchaisedNotification’ in ReplicatedStorage
ServerScript:
local ms = game:GetService("MarketplaceService")
local PurchaseId = 1233838337 -- Your Shirt ID here
ms.PromptPurchaseFinished:Connect(function(plr, purchaseid, purchased)
if purchaseid == PurchaseId and purchased then
local plrName
for _, v in pairs(game.Players:GetPlayers()) do
if v.UserId == plr then
plrName = v.Name
end
end
game.ReplicatedStorage.PurchaisedNotification:FireAllClients({
Text = ("Message Here!");
Color = Color3.fromRGB(206, 165, 255);
Font = Enum.Font.SourceSansBold;
TextSize = 18
})
end
end)
This works but is there anyway I could like make it say in the message the player who bought the shirt there name would come and it would say bought a shirt