Please help with this tp issue

So basically I have this game where you get queued up into a server with a party of up to 12
that works fine, but going through exit door sends you all to diff servers…
I really want all players in server to get teleported when one person exits
but no one can fix it for me… please fix?

heres it:

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)

its in a part named exit and I get no errors

1 Like

You’re generating a new reserved server and code every time the function is ran, you need to generate that wherever you’re building the party of players.

2 Likes

dude the party thing is in another place wdym?? can u just fix this script

In simpler terms, your making a new code that links to a specific server where the selected player(s) will be teleported. Every time the part is touched, it will a generate a new code that leads to a whole different server (which is what you do not want). In order to solve this, you need to already make a code when a party is created and use that as the ReservedServerAccessCode, so that way once they touch that part they will get sent the server that is associated with the code you created for the party.

Also, next time be nicer when people are trying to help you, he’s already helping you fix that script. If you do not understand what he’s saying, you could’ve asking him to elaborate or something.

idk what this means, I haven’t gotten a answer that means anything in 10 posts everyone just says some vague thing thats made by chatgpt…

It’s not some “vague thing thats made by chatgpt”, it’s an explanation. Not at all the time we will simply fix the code and get your thing working. Just make a code for the party and use that for the second argument for TeleportToPrivateServer

idk what that means, someone made that for me im kinda stuck