Matchmaking Script

  1. What do you want to achieve?
  • I want to make a matchmaking system with a minimum of 8 players and a maximum of 16 players.
  • I also want to put a player count under the label that is going to say ex: 7/16 players
  • A button to leave the platform.
  1. What is the issue?
    I’m trying to add minimum players and a maximum, but I don’t know how to do it.
  2. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have searched for answers on how to do fix the problem but have found nothing.Screenw
local ID = 6502752548
local TIME = 20 -- Time before starting a match
local WAIT_MSG = "Next match starts in"
local TP_MSG = "Teleporting players to match"
local TP_VALUE_DELAY = 5

while true do
	wait()
	for i = TIME,0,-1 do
		script.Parent.Timer.SG.TL.Text = WAIT_MSG .. " " .. i
		wait(1)
	end
	script.Parent.Teleporting.Value = true
	local PlrTable = {}
	local Characters = script.Parent.Players:GetChildren()
		if Characters[1] ~= nil then
	for i = 1 , #Characters do
		wait(math.random(0.1,2.1))
		PlrTable[#PlrTable + 1] = game.Players:GetPlayerFromCharacter(Characters[i])
	end

	repeat wait() until #PlrTable >= #Characters
	local Code = game:GetService("TeleportService"):ReserveServer(ID)
		
	if script.Parent.Vehicle.Value == false then
	game:GetService('TeleportService'):TeleportToPrivateServer(ID,Code,PlrTable)
		else
		for i = 1 , #PlrTable do
			local c = PlrTable[i].Character:GetChildren()
			for i2 = 1 , #c do
				if c[i2].ClassName == "Acessory" then
					c[i2]:Destroy()
				end
				if c[i2].ClassName == "Part" then
					c[i2].Transparency = 1		
				end
			end
		end
		wait(3)
			game:GetService('TeleportService'):TeleportToPrivateServer(ID,Code,PlrTable)
	end
	script.Parent.Timer.SG.TL.Text = TP_MSG
	end
	wait(TP_VALUE_DELAY)
	script.Parent.Teleporting.Value = false
end

Screenshot 2021-03-19 033155

Make a local called minimum and another called max,

local min = script.min (min would be numbervalue)
local max = script.min (max number value aswell)
make the values the amount u need,

now make it so if its above => the min it allows the gui / so to start

and if <= then max it doesnt allowed more players

also make a Players numbervalue
and when player is added it goes up but when player leaves it goes down

Oh… i’m sorry but I don’t know how to do that :confused: