Messaging Service Custom Server Fill Help

I created this script that uses MessagingService to merge smaller servers into larger ones if there is room available. For some reason it seems to work for a bit but then randomly stops working after some time goes by. I made it so that each server has a random 8 digit ID as a number, and I use this instead of sending game.JobId over and over again because I figured it would keep me further away from breaking the MessagingService limits. I only send the JobId once a server sees a server that it wants to teleport to. It makes a request to that servers unique MessagingService topic which then returns the JobId back to the server so that it can send players there. Why is this randomly stopping!?

if not (game.VIPServerId == "" and game.VIPServerOwnerId == 0) then
	script.Enabled = false
	wait(100000000)
end

local messagingService = game:GetService("MessagingService")
local teleportService = game:GetService("TeleportService")
repeat
	wait()
until game.ReplicatedStorage.ServerId.Value ~= 0
local myID = game.ReplicatedStorage.ServerId.Value
local getData = require(game.ReplicatedStorage.GetData)

local justRequested = false
local justSent = false

wait(5)
--DATA RECIEVER
repeat
	local subscribeSuccess, subscribeConnection = pcall(function()
		return 
			messagingService:SubscribeAsync("ServerSize",function(message)
				local data = message.Data
				local myplayers = game.Players:GetChildren()
				if data["ServerID"] ~= myID then
					--print(data["ServerID"]..": "..data["PlayerCount"])
				end
				if data["PlayerCount"] > #myplayers and data["ServerID"] ~= myID and data["PlayerCount"] < 46 and 44-data["PlayerCount"] >= #myplayers and #myplayers <= 18 then
					if justRequested == false then
						--print("REQUESTING JOB ID FROM: "..data["ServerID"])
						justRequested = true
						local requestData = {}
						requestData["RequesterID"] = myID
						messagingService:PublishAsync(tostring(data["ServerID"]),requestData)
						wait(20)
						justRequested = false
					end
				end
			end)
	end)
	wait(3)
until subscribeSuccess == true

--REQUEST RECIEVER AND TELEPORT SEND
repeat
	local subscribeSuccess, subscribeConnection = pcall(function()
		return
			messagingService:SubscribeAsync(tostring(myID),function(message)
				local data = message.Data
				if data["RequesterID"] ~= nil and justSent == false then
					justSent = true
					--print("JOB ID REQUESTED FROM: "..data["RequesterID"])
					local sendData = {}
					sendData["JobId"] = game.JobId
					messagingService:PublishAsync(tostring(data["RequesterID"]),sendData)
					wait(30)
					justSent = false
				end
				if data["JobId"] ~= nil then
					--print("RECIEVED JOBID FROM: "..data["JobId"])
					local players = game.Players:GetChildren()
					for i = 1, #players do
						local PD = getData.getDataFromPlayer(players[i])
						--if PD and (PD.Queue.Value == "" or PD.Queue.Value == nil) then
						teleportService:TeleportToPlaceInstance(13656243663,data["JobId"],players[i])
						--end
					end
					game.Players.PlayerAdded:Connect(function(player)
						teleportService:TeleportToPlaceInstance(13656243663,data["JobId"],player)
					end)
				end
		end)
	end)
	wait(3)
until subscribeSuccess == true

--SEND EVENT
script.Send.Event:Connect(function()
	local data = {PlayerCount = 0, ServerID = myID}
	local myplayers = game.Players:GetChildren()
	data["PlayerCount"] = #myplayers
	if #myplayers > 4 and #myplayers < 40 then
		messagingService:PublishAsync("ServerSize",data)
	end
end)

--SEND EVENT LOOP FIRE
while true do
	wait(8)
	script.Send:Fire()
end

Hello. For this script’s premise, I believe you have overcomplicated it a bit.
I have made one like this before, and I’d like to note that many users complain about it, for some prefer smaller servers, but here!

This script is messy and due for cleaning up, and it isn’t entirely bug-fixed, but it definitely does work, albeit sometimes smaller servers will exist for longer than they should.

if game.PrivateServerId == "" and game.PrivateServerOwnerId == 0 then
	local ms = game:GetService("MessagingService")
	ms:SubscribeAsync("Update",function(message)
		local data = message.Data
		if data[1] ~= game.JobId then
			if data[2] > #game.Players:GetPlayers() then
				for i,v in pairs(game.Players:GetPlayers()) do
					spawn(function()
						game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId,data[1],v)
					end)
				end
			end
			ms:PublishAsync("Update",{game.JobId,#game.Players:GetPlayers()})
		end
	end)
	ms:PublishAsync("Update",{game.JobId,#game.Players:GetPlayers()})
end

Also, messagingservice’s limits won’t be capped by using the full JobId.
I suspect your issue might’ve been errors, or possible rate limiting. Did you take a peek at debugging or seeking errors in console?

This script is a new version of an old script I made. My original script was more simple like the one you sent but it would stop even if I only published to the topic once every 10 seconds. How can these scripts be getting anywhere close to the rate limit!? No console errors.