Attempt To Teleport To A Restricted Place

Hi! I am currently having issues with my teleport system which btw uses Reserved servers. Everytime I try and teleport a multiple players to a server then always 1 person says attempted to teleport to a place thats restricted. And before you ask yes I did enable HTTP Requests and Third Party teleports. Here’s my script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")
local Code = TeleportService:ReserveServer(14538216434)

local Game = ReplicatedStorage.Game
local GUI = Game.GUI
local RemoteEvents = Game.RemoteEvents

RemoteEvents.TeleportParty.OnServerEvent:Connect(function(player,Owner)
	if player.Name == Owner then
		local ServerMembers = {}
		for _,v in pairs(ReplicatedStorage.Servers:FindFirstChild(Owner):GetChildren()) do
			table.insert(ServerMembers,game.Players:FindFirstChild(v.Value))
		end
		print(Code)
		TeleportService:TeleportToPrivateServer(14538216434,Code,ServerMembers)
	end
end)

Any help will be appreciated.

3 Likes

Are you testing in Roblox Studio or in Roblox itself?

It could be that the one player isn’t allowed to teleport to this place because you only are the owner of the place you want to teleport to.

try this

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")
local id = 14538216434

local Game = ReplicatedStorage.Game
local GUI = Game.GUI
local RemoteEvents = Game.RemoteEvents

RemoteEvents.TeleportParty.OnServerEvent:Connect(function(player, Owner)
	if player.Name ~= Owner then return end
    local Code = TeleportService:ReserveServer(id)
	local ServerMembers = {}
	for _, v in ReplicatedStorage.Servers:FindFirstChild(Owner):GetChildren() do
	   table.insert(ServerMembers, game.Players:FindFirstChild(v.Value))
	end
	print(Code)
    local TO = Instance.new("TeleportOptions")
    TO.ReservedServerAccessCode = Code
    TeleportService:TeleportAsync(id, ServerMembers, TO)
end)
1 Like

I am teleporting it in roblox it self and the place is public so i don’t know why it wouldn’t want to

This works but instead of reserving the server it uses 1 code for all the servers which means that if 1 person joins and teleports to a reserve server and if someone else joins and teleports then they get teleported to the same reserved server

Nevermind all i had to do was put the local Code = TeleportService:ReserveServer(id)

inside of RemoteEvents.TeleportParty.OnServerEvent:Connect(function(player, Owner) if player.Name ~= Owner then return end local ServerMembers = {} for _, v in ReplicatedStorage.Servers:FindFirstChild(Owner):GetChildren() do table.insert(ServerMembers, game.Players:FindFirstChild(v.Value)) end print(Code) local TO = Instance.new("TeleportOptions") TO.ReservedServerAccessCode = Code TeleportService:TeleportAsync(id, ServerMembers, TO) end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.