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.
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.
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
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