Round Based System

I have a game that has multiple worlds and each world is supposed to have a round based system where you can vote to get teleported to a map

How would I make it so that for example players who’s at world 2 wouldn’t get teleported to maps for players in world 1?

My script makes it so that every player in game would be teleported to the map how would you go on about to make it a separate system for each world?

The solution i have right now is a different place for each world but I want all worlds in one game

You could use a 2D array to store all the worlds, and then within them store all the players IDs (easier to use with a function which will be used in a minute, plus easier to differentiate players) within those worlds. For example,

local worldsData = {
  {11923173, 68735475, 82372149, 39247329} -- Would be world 1 as it's the first index
  {58634854, 38148123, 20138431} -- World 2
  {} -- etc etc
}

Then, you could use a function to get all the players by running through this table.

local worldData = -- worlds table here
local function GetPlayersInWorld(worldNum)
 
   local playerTable = {}
   for _, v in pairs(worldData[worldNum]) do
      playerTable:insert(game.Players:GetPlayerByUserID(v)) -- Inserts the player reference into the array
   end
   return playerTable
end