Queue System Player Does Missions

What am I trying to do?

I’m trying to script a system where a player presses L on their keyboard a GUI pops up. As you can see, I already did this part. After that I want the player to be put into a queue system where it waits until two people are queued. Once two people are queued they both teleport to a spot on the map. …

What I need help with?

I need a beginner help in the queueing system. I need a system where once two players both have clicked it and are waiting. The queue system does what it needs to do. I have no idea on how to do this and need help from any scripter.

GUI: https://gyazo.com/34c5a2f7a452d6d8a54175d5295c5ba4

1 Like

I’m confused, what do you mean?

1 Like

I want a script that makes it once a player click the gui named solo which I shown. Another player clicks it to. Once there two players that have clicked it the script does what I want it to do. I don’t know how to check if there a player waiting or two player waiting. i heard people say use a folder or something.

2 Likes
for i, v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild("OnQueue") then
table.insert(table, v)
end
end

while true do
local amount = table[#v]
if amount >= 2 then
--blah blah blah
end
wait()
end

it still might not work but when you put an #, it can be like a number, you can find a devforum post where someone asks for help about indicating if there is 2 players for the intermission and the solution

2 Likes

here’s one that i found Changing Text if there are 2 players on the server? - #22 by Angiris_treecreeper

2 Likes

Yeah that what I meant. I have one more question. I’m not that good with tables so in the beginning of the script I do this.

table = {}
table.insert add a person to table
table.remove remove  person from table

??

1 Like

back

table.insert is like adding a person to a table, this is how it works “table.insert(table, player)”
table.remove is the same but it opposite, in simple terms it removes the player from the table if it is in the table “table.remove(table, player)”

you use table.insert when you want to queue the player and table.remove when the player exits the queue

1 Like