I want to teleport players who touched a part but it teleports each to a private server. This is my script

local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local DSS = game:GetService("DataStoreService")
local DS = DSS:GetGlobalDataStore()
local ds = {}


function Joined(plr)
	table.insert(ds,plr)
	for k,v in pairs(ds) do		
		TP(v)
	end
end

function TP(v)
	local code = TS:ReserveServer(4696584041)
	TS:TeleportToPrivateServer(4696584041,code,{v})

end



local part = game.Workspace.Teleport
part.Touched:Connect(function(hit)
	local check = hit.Parent:FindFirstChild("Humanoid")
	if check ~= nil then
		local plr = game.Players:GetPlayerFromCharacter(check.Parent)	
		Joined(plr)
	end
end)

2 comments

0

What do you mean by a private server? Do you mean a server with multiple spots for players in the same game, or a server with one player in a different game? Please specify.

0

I want to create a story game, i want to tp multiple players to a place in that game