Teleport service teleporting second player, double teleports and says restricted place

Description:
so i went to teleport a player using the teleport service api, it teleported them to the game fine, but then proceeded to teleport them right after again, then gave an error saying “restricted place”

Place:

This started happening when i tried to use the teleport service to teleport players, i tried to just teleport them straight to the place, it gave the error, i tried to reserve a server, still gave the error, this is definitely a roblox issue.
Code on the red brick:

local oldinstance = nil

script.Parent.MouseClick:Connect(function(player)
	local ts = game:GetService("TeleportService")
	
	if(oldinstance==nil) then
		oldinstance = ts:ReserveServer(4803477973)
	end
	
	ts:TeleportToPrivateServer(4803477973, oldinstance, {player}, nil,
			{
				["isLoader"] = true,
				["mapToLoad"] = 100
			}
		)
	
	script.Parent.Parent.Color = Color3.new(0,1,0)
	wait(0.5)
	script.Parent.Parent.Color = Color3.new(1,0,0)
end)

How to reproduce:
IMPORTANT NOTE: THIS REQUIRES 2 PLAYERS TO REPRODUCE!
Step 1: Wait for the players to load into the initial place
Step 2: player 1 clicks the read brick
Step 3: player 2 waits for player 1 to dissappear, then click the red block
Step 4: player 2 will get the restricted place error

1 Like