Anyway to force every player in every server to a different game?

anyway to force every player in every server to a different game?

You would use MessagingService to Communicate with each server.

And then use a for loop to get all the Players to Teleport them with TeleportService

can you give me an script? example or something?

It isnt that Difficult,

For MessagingService:

When using MessagingService, you would call the function SubscribeAsync to create a Topic for the Servers to Listen to.

Code should look like this:

local MessagingService = game:GetService("MessagingService") -- Service
local TeleportService = game:GetService("TeleportService") 

MessagingService:SubscribeAsync("NewTopic", function() -- Callback to Communicate
-- code
end)

Topic is a string assigned for the Servers to listen to.

To Call this New Topic, you will use PublishAsync, This is fire for every Server.

MessagingService:PublishAsync("NewTopic") -- Fires the specified Topic

For the Players

You get All the Players by using game.Players:GetPlayers()

GetPlayers is an Array of Players

the for loop is to fire for the amount of players in the Server. This is also where TeleportService comes in.

for number, player in pairs(game.Players:GetPlayers()) do -- looks through a list of Players

TeleportService:Teleport(PlaceId, player) -- Teleports Players

end

In All, your Code should look like this:

MessagingService = game:GetService("MessagingService")

TeleportService = game:GetService("TeleportService")


MessagingService:SubscribeAsync("NewTopic", function()
for number, player in pairs(game.Players:GetPlayers()) do

TeleportService:Teleport(PlaceId, player)
end
end)
MessagingService:PublishAsync("NewTopic")

MessagingService has Limits, I recommend reading about it.

Documentation:

1 Like