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?