So as the title says, the function(message) does not reset every time I use SubscribeAsync(), and the new data is combined with the old data. Does anyone know how to fix this?
local success, errormes = pcall(function()
return messagingService:SubscribeAsync("TestMessage", function(message)
print(message.Data) -- this prints one string at first, then the second time it prints the first string and the new one.
end)
end)
if success then
game.Players.PlayerRemoving:Connect(function()
errormes:Disconnect()
end)
else
warn(errormes)
end
local Publishsuccess, Publisherrormes = pcall(function()
messagingService:PublishAsync("TestMessage", "This is a test")
end)