I’m having an issue with my MessagingService event. It used to work fine before but somehow stopped working when I tested it earlier today. The OnProductBought function runs fine, and it also prints “Publish”, but either it doesn’t properly call PublishAsync, or SubScribeAsync is never received. Even when using a print statement in the SubScribeAsync connection, it doesn’t print. Anyone knows what the issue could be?
Yes this is a server script
MessagingService:SubscribeAsync("LuckEvent", function(message)
activateLuckEvent(message.Data) -- This never runs
end)
local function OnProductBought(player)
-- Publish message to activate event
local message = {
Data = {
buyer = player.Name,
}
}
print("Publish") -- This prints
MessagingService:PublishAsync("LuckEvent", message)
end
events.BoughtLuckEvent.Event:Connect(function(player)
OnProductBought(player)
end)