Roblox keeps on having problems with TeleportService x MessagingService

So I’m trying to join a player of any server as long as they are actively playing the game. To test this, I’m joining myself, but the game says that the client disconncted (error 285) or roblox shut the server down for maintence.(error 275)

My method is to find the target by using MS:PublishAsync witht the topic, and the player we are looking for. Now the game also subscribes to the topic, and if any server publishes async with this topic, it should loop through the players and if they are in game, teleport the person who wanted to join that person to the server.

The code looks a little like this:

local playerToJoin = "ROBLOX"
MS:PublishAsync("JoinPlr", playerToJoin)

game.Players.PlayerAdded:Connect(function(player)
	MS:SubscribeAsync("JoinPlr", function(msg)
		if game:GetService('Players'):FindFirstChild(tostring(msg.Data), false) then
			TS:TeleportToPlaceInstance(game.PlaceId, game.JobId, player)
		end
	end)
end)

What am I doing wrong and how can I fix it?

1 Like

If you are joining yourself it means that the server you are in closes and when you try to join the server you are in, it simply doesn’t exists anymore

1 Like

Oh, so if I join someone else, it’s going to work?

1 Like

Yes at least 1 player needs to be in the server else it will not work