I need some help on a game I'm making. It has different queues so it reserves private servers for groups of people. I know how to do that part but how do I make it so only a certain amount of people can get into the queue. I'm using a teleporter to transport the groups but how do i make it so that once 3 people get in the queue no more people can join.
make a value and every time a person joins the queue it rises by 1. And before the person joins the queue, you check if the value is less than 3.
The script should go something like this:
local queueval = Instance.new("IntValue") game.Players.PlayerAdded:Connect(function() queueval.Value = queueval.Value + 1 end) couroutine.wrap(function() while wait() do if queueval.Value == 3 then --script to teleport here end end end)()
Should work if it doesnt let me know