No idea how to do this

so I have a level transport system (this queues into lvl 1 and u go into lvl2 later…)

I want it to be to where when all players reach a certain radius of it all of them get transported into another reserved server

but I dont know how to make it to where it goes into a reserved server (players who go into it get mixed in with players in diff server instead of it being party based) (a nice fellow maked queue reserved server based… but the lvl transport he couldnt do…) pls help… im way novice scripter so saying answer wont help much… please give a simple fix/tips/referal to a vid

local telePart = script.Parent
local TeleportService = game:GetService('TeleportService')
local placeID = (13050238945)
local canTeleport = true

local function otherGame(otherPart)

	local player = game.Players:FindFirstChild(otherPart.Parent.Name)

	if player and canTeleport then

		canTeleport = false

		TeleportService:Teleport(placeID, player)

		wait(0.3) --cooldown time

		canTeleport = true

	end

end

telePart.Touched:Connect(otherGame)

(if u have time make it to where after 1 minute of standing at exit it just transports all players but that would be ok if not)

4 Likes
2 Likes

im sorry I have 0 coding experience :confused: I sorta dont know how to do this and would like someone to like atleast do the reserved server thing… I can code the rest :slightly_smiling_face:

2 Likes
local telePart = script.Parent
local TeleportService = game:GetService('TeleportService')
local placeID = (13050238945)
local canTeleport = true

local function otherGame(otherPart)

	local player = game.Players:FindFirstChild(otherPart.Parent.Name)

	if player and canTeleport then
                 
		canTeleport = false
                local ReservedServerAccessCode = TeleportService:ReserveServer(placeID)
		TeleportService:TeleportToPrivateServer(placeID, ReservedServerAccessCode, {player})

		wait(0.3) --cooldown time

		canTeleport = true

	end

end

telePart.Touched:Connect(otherGame)
2 Likes

question, if not all players get teleported at once, (game is party based but rn not all players get teleported when 1 gets to the exit, will all of them get put in seperate reserved servers,??)

1 Like

Yes, i can fix that:

local telePart = script.Parent
local TeleportService = game:GetService('TeleportService')
local placeID = (13050238945)
local canTeleport = true
local FirstPlayer = true
local ReservedServerAccessCode = nil

local function otherGame(otherPart)

	local player = game.Players:FindFirstChild(otherPart.Parent.Name)
	if player and canTeleport then
                 
                if FirstPlayer == true then
                  ReservedServerAccessCode = TeleportService:ReserveServer(placeID)
                  FirstPlayer = false
                 end
		canTeleport = false
		TeleportService:TeleportToPrivateServer(placeID, ReservedServerAccessCode, {player})

		wait(0.3) --cooldown time

		canTeleport = true

	end

end

telePart.Touched:Connect(otherGame)
1 Like

I also asked other people to make it teleport all players but all 12 scripts they have sent never work… if u can make all players teleport when one player touches it it would be great! (also maybe put a – note where I could put stuff to happen before all players get teleported… like I could make a gui pop up saying “Myname got to the exit”)

Check if Thirty Part Teleport enabled, if no then enable it, and test it in roblox, not in roblox studio, teleport s are disabled in roblox studio.
Okey here is script:

local telePart = script.Parent
local TeleportService = game:GetService('TeleportService')
local placeID = (13050238945)
local canTeleport = true
local FirstPlayer = true
local ReservedServerAccessCode = nil

local function otherGame(otherPart)

	local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
	if player and canTeleport then
                 
                if FirstPlayer == true then
                  ReservedServerAccessCode = TeleportService:ReserveServer(placeID)
                  --you can put code for other thinks like this here, if you want to show first player who touched part
                  FirstPlayer = false
                 end
		canTeleport = false
		TeleportService:TeleportToPrivateServer(placeID, ReservedServerAccessCode, {game:GetService("Players"}:GetPlayers()})

		wait(0.3) --cooldown time

		canTeleport = true

	end

end

telePart.Touched:Connect(otherGame)
1 Like

Use subplaces (add more places to the game)

2 Likes

I did. Im telling you, the scripts I was given were just wrong.

2 Likes

Woot, that was fun! Not sure if the private server part works. Nothing to test that with.
But, I did test just a different server (then I took a line from mpc19801981, muahahaa).

-- non-local script in ServerScriptService

local teleportPart = game.Workspace:WaitForChild("TeleportPart")
local destinationPlaceId = 123456789
local privateServerPlaceId = 123456789
local teleportRadius = 25

local playersInRadius = {}

local function checkAllPlayersInRadius()
	for _, player in pairs(playersInRadius) do
		local character = player.Character
		if character then
			local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
			if humanoidRootPart then
				local distance = (teleportPart.Position - humanoidRootPart.Position).Magnitude
				if distance > teleportRadius then
					return false
				end
			end
		end
	end
	return true
end

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		table.insert(playersInRadius, player)

		character:WaitForChild("HumanoidRootPart")

		while true do
			wait(0.1)

			if checkAllPlayersInRadius() then
				for _, p in pairs(playersInRadius) do
					local success, errorMessage = pcall(function()
					--	game:GetService("TeleportService"):Teleport(destinationPlaceId, p)
						game:GetService("TeleportService"):TeleportToPrivateServer(privateServerPlaceId, "", {p})
					end)
					if not success then
						warn("Failed to teleport player:", errorMessage)
					end
				end
				break
			end
		end
	end)
end)

All players need to be within range of the port part and it will port them all.

2 Likes

im getting very confused now… so this didnt even work… maybe u can send me a freemodel cause clearly something is wrong (every script I have tested doesnt work)

2 Likes

I missed a “p” called it player … try it again. Also you may need to look at the private server port line.
It works fine to just a new game.

2 Likes

So I tested heavily in a roblox server (not studio) ALL security settings on …

local teleportPart = game.Workspace:WaitForChild(“TeleportPart”) I changed this line to be my part

the script is non local and in server script service and the only error I get is this

Teleport to ReservedServer failed : HTTP 403 (Forbidden)

1 Like

so I have been using a script for a bit thats made by another guy and it works… but when he tried to make it teleport all players in any way for everyone it just breaks the script

AND TO PROVE IM NOT DOING SOMETHING WRONG. I GET THIS ERROR WHEN I USE THE GOOD ONE (this means its actually teleporting Ik im getting a error it doesnt work cuz what its teleporting is private yada yada but u get my point it actually is teleporting)

Screenshot 2023-09-22 201308

1 Like

Press F9 in your game to see details of any error.

1 Like

Teleport to ReservedServer failed : HTTP 403 (Forbidden) already said this in my post but here

1 Like

I still have that test with one other portal test … GameA teleports to GameB
Yours is the one on the left (the blue ball)

GameA
GameB

You can edit both. Just tested them and they work as desired.

“Teleport to ReservedServer failed : HTTP 403 (Forbidden) already said this in my post”
Is what the popup said … F9 Logs will tell you way more information.

What is the use of putting together a full working example of this and you don’t even look at it.
Did you just want to pout or is the a joke …

1 Like

Make sure all the places are published.

2 Likes

If you checked all things people said before then check if placeId is correct.