MessageService Help

So I was making a call system, globally but the problem is… I cannot have both the messageservice subscribed to a topic. The only one that would fire is the first topic.

Server Script:

local teleportService = game:GetService("TeleportService")
local playerService = game:GetService("Players")
local messageService = game:GetService("MessagingService")
local remoteFunction = game.ReplicatedStorage.callSystem
local GUI = game.ReplicatedStorage.HR_ONLYUI
local clonedGUI
local currentRequests = {}

local function handleInput(DataTable)
	for _, player in pairs(playerService:GetPlayers()) do
		if player:GetRankInGroup(32532119) >= 8 then
			if not player.PlayerGui:FindFirstChild("HR_ONLYUI") then
				clonedGUI = GUI:Clone()
			end
			clonedGUI.Parent = player.PlayerGui
			local teleport = remoteFunction:FireClient(player, DataTable.Data.Username, DataTable.Data.DisplayName, DataTable.Data.helpMessage, DataTable.Data.id)
		end
	end
end

	
game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message)
		local loweredstring = string.lower(message)
		local args = string.split(message, " ")
		if args[1] == "!call"  and not currentRequests[player.Name] then
			local reason = string.sub(message, 7, #message)
			messageService:PublishAsync("CallSystem", {
				Username = player.Name,
				DisplayName = player.DisplayName,
				helpMessage = reason,
				id = game.JobId
			})
			print(game.JobId)
		end
	end)
end)

game.ReplicatedStorage.callSystemDeleteRemote.OnServerEvent:Connect(function(player, Username)
	messageService:PublishAsync("removePlayer", {
		Username = Username
	})
	for _, player in pairs(playerService:GetPlayers()) do
		if player:GetRankInGroup(32532119) >= 8 then
			game.ReplicatedStorage.callSystemDelete:FireClient(player, Username)
		end
	end
	currentRequests[Username] = nil
end)

messageService:SubscribeAsync("removePlayer", function(DataTable)
	for _, player in pairs(playerService:GetPlayers()) do
		if player:GetRankInGroup(32532119) >= 8 then
			game.ReplicatedStorage.callSystemDelete:FireClient(player, DataTable.Data.Username)
		end
	end
end)

messageService:SubscribeAsync("CallSystem", function(DataTable)
	handleInput(DataTable)
	currentRequests[DataTable.Data.Username] = true
end)

Thanks in advance!

1 Like

The second SubscribeAsync doesn’t connect?

1 Like

Can you please elaborate on it more?

1 Like

Nope, only one async fires correctly.

1 Like

If you add a print statement between the 2 connections, is it ran?

1 Like