Problem with Matchmaking system

Currently I am using Reserved Servers, however when a player joins a party, and click start, they teleport to a reserved server. The issue however, is that other players can join the same reserved server, even if they weren’t in the party. If they just make another party and also teleport, it puts them into the same reserved server. This is the code:

elseif instruction == "startParty" then
		
		if game.ReplicatedStorage.Parties:FindFirstChild(value1) and game.ReplicatedStorage.Parties[value1].Players["Party Leader"].Value == player.Name then
			
			local playersToTP = {}
			
			for i, playerInParty in pairs(game.ReplicatedStorage.Parties[value1].Players:GetChildren()) do
				
				table.insert(playersToTP, game.Players[playerInParty.Value])
			end
		
			local AccessCode = tps:ReserveServer(placeId)
			tps:TeleportToPrivateServer(placeId, AccessCode, playersToTP)
		end
	end

I have no idea what I’m doing wrong. If the solution lies in somehow locking the reserved server afterwards, can you please explain how.

1 Like