PublishAsync returns nil

local data = {
    Recipient = player.Name;
    Attempts = player.Attempts.Value;

MessagingService:PublishAsync(“GlobalAnnouncement”, function(data)

This is not the full script but I have a SubscribeAsync function that just prints the data but it prints nil

PublicAsync() does not take a function as the second argument, change to:

MessagingService:PublishAsync("GlobalAnnouncement", data)

Source: MessagingService:PublishAsync

I am pretty sure I tried it without a function and it still returned nil