im tryna send a global chat message whenever somebody donates robux but it doesnt work
code:
MessagingService:SubscribeAsync("Global", function(msg)
ReplicatedStorage.Events.Chat:FireAllClients(msg.Data[1])
end)
for i, v in pairs(workspace.Spawn.TimePadsBoard.SurfaceGui.Stats.Donate.ScrollingFrame:GetChildren()) do
if v:IsA("TextButton") then
productFunctions[v.ProductID.Value] = function(receipt, player)
player.Data.RobuxDonated.Value += string.sub(v.Name,7)
local Message = "[GLOBAL] " .. player.Name .. " donated " .. string.sub(v.Name,7) .. " robux! Thank you!"
print(Message)
MessagingService:PublishAsync("Global", Message)
return true
end
end
end
it actually prints out the intended text but it fails at publish async