QueueService: A simple module for all your queuing needs!

QueueService

Download | Wiki

I have recently started learning to work with OOP and since I was creating a queuing system for a project of mine I decided to make this easy-to-use module for all your queuing needs!

Why should I use this?

QueueService was created with configuration and simplicity in mind while also being friendly to new developers. With all the configuration you could possibly need QueueService can be used in any queuing context; whether it’s from a UI or a touch detecting pad!

Cross-place queuing, automatically!

This module supports cross-place queuing, so if you want everyone in the queue to be teleported to another place all you have to do is supply the PlaceId

Planned updates

I was planning on making this module handle the queue after the players were teleported as well but I wasn’t able to do it from my knowledge.

I am no longer updating this module, I ran out of time.

Want to learn more?

I have created an in-depth wiki on this module, if you’re interested you can find the wiki here

Have any questions/comments?

Feel free to leave a reply to this post, I will try to get back to you as soon as I can!

24 Likes

This isn’t matchmaking your title is misleading

It’s merely an extention to Teleport service, this however is Module actually does Cross Server Matchmaking

Despite that, queuing / party is part of Matchmaking so it’s not entirely a false claim?

You just lack other features to call it a full fledged Matchmaking system, good job nonetheless.

2 Likes

If I said,

“KitchenAid: For all your cooking needs!”

Am I being misleading? It sounds very standard to what you would normally hear. KitchenAid sells cookware that doesn’t do the cooking for you, doesn’t buy the ingredients, and doesn’t pay for your electric/gas bill. But it makes sense, cookware is very helpful for cooking.

I would say, an improved version of teleport service is very helpful for matchmaking. It’s not MatchMakingService, it’s QueueService, and it can support matchmaking development. Just like cookware supports cooking.

9 Likes

It is a queue-based module in description yet you mention matchmaking in the title which can look misleading. You may want to clarify that.

The module looks simple. You could instead use coroutines instead of spawning functions by the way.

It doesn’t work, it does not teleport the players. I am in studio and testing this and I get no message in the output saying “You cannot teleport in studio” unless that’s in a PCALL. I need to test it with a real place ID

1 Like

Here is my server script:

local Players = game:GetService("Players")
local SSS = game:GetService("ServerScriptService")
    
--Queue Settings--
local MaxPlayers = 2 --The maximum players that can be added to the queue
local MinStart = 1 --The minimum amount of people that can trigger the queue countdown
local CountTime = 10 --The amount of time until the queue is initiated after MinStart is achieved
local PlaceId = 5557351207 --The place to teleport the players to on completion (OPTIONAL)
    
local QueueService = require(SSS.QueueService)
local MyQueue = QueueService:Create(MaxPlayers, MinStart, CountTime, PlaceId)
    
Players.PlayerAdded:Connect(function(player)
    MyQueue:AddPlayer(player)
end)

Players.PlayerRemoving:Connect(function(player)
	MyQueue:RemovePlayer(player)
end)
    
MyQueue.PlayerAdded:Connect(function(player)
    print(player.Name.." has been added to the MyQueue")
end)
    
MyQueue.PlayerRemoved:Connect(function(player)
    print(player.Name.." has been removed from MyQueue")
end)
    
MyQueue.Initiated:Connect(function()
    print("Queue was initiated")
end)

It doesn’t print “Queue was initiated”

1 Like

Nevermind! I fixed it! Had to do:

MyQueue:Start()

Sorry about that, I need to make it more clear that you need to start it

2 Likes

Thanks for your suggestion, I will fix the title

2 Likes

Also I do plan to add more features as far as the teleporting goes.

1 Like

Nice, the teleportation doesn’t seem to be working for me either. I have two games (one being the queue service game and another one is the tp-to game) but QService won’t teleport the players to the tp-to game. Here is my current script:

local Players = game:GetService("Players")
local SSS = game:GetService("ServerScriptService")

local MaxPlayers = 700
local MinStart = 1
local CountTime = math.random(10, 30)
local PlaceId = 5537670256

local QueueService = require(SSS.QueueService)
local MyQueue = QueueService:Create(MaxPlayers, MinStart, CountTime, PlaceId)

MyQueue:Start()

Players.PlayerAdded:Connect(function(player)
	MyQueue:AddPlayer(player)
end)

Players.PlayerRemoving:Connect(function(player)
	MyQueue:RemovePlayer(player)
end)

MyQueue.PlayerAdded:Connect(function(player)
	print(player.Name.." has been added to the queue")
end)

MyQueue.PlayerRemoved:Connect(function(player)
	print(player.Name.." has been removed from the queue")
end)

MyQueue.Initiated:Connect(function()
	print("Function is working but teleporting isn't!")
	MyQueue:Teleport()
end)

local function getTimeLeft(num)
	for _, plr in pairs(Players:GetPlayers()) do
		plr.PlayerGui:WaitForChild("ScreenGui").Time.Text = CountTime - num.."s"
	end
end

MyQueue:BindToCount("MyBind", getTimeLeft)

It does print “Function is working but teleporting isn’t!”

Did you make sure you used the proper id?

Yep, I did.

It goes to my game called “Lights”

It used to work when I was using the ID for my qservice game so it kept loop-tping the player into the qService game but now that I changed the ID, it doesn’t tp.

Is the place in the same universe as the queue game?

The teleport system does not support cross-game queuing if that’s what you’re trying to do. The place must be a part of the same game.

Edit: In case your are confused you might find this article helpful

1 Like

Oh. Why does it not support cross-game tp?

Can you make it support it tho?

I don’t think it is possible to teleport groups of people into the same server in another game.

You could try creating a new place in the game you are trying to teleport to?

1 Like