Help with making a queue

Hey there,
I am trying to make a game where you join a queue for an obby and wait for 1 other player to join then it teleports you to the obby and you race to complete it. Does anybody know how to make this work?

How I want the game to work:
Player goes up to the sign and readys up and waits for another player to join. Once another player joins both players are teleported to the obby and it counts down from 3 and then both players race to the end of the obby, once somebody wins both players freeze and in the chat it annouces who won and the winner gets 50 crowns (a leaderstat)
1412

1 Like

Use a touched event or raycasting (your choice) to see if a player is ready, then change the sign text to 1/2 Ready. Do this again for the second player, then teleport them. To freeze them, set their WalkSpeed to 0 and JumpPower to 0 if you don’t want them to jump either. For the winner chat message, you can use a RemoteEvent and FireAllClients, and on the client you can use StarterGui:SetCore("ChatMakeSystemMessage") once FireAllClients is called. To change the leaderstat, just edit the ObjectValue.

2 Likes

Thanks for help but how can I detect how many players are readyd up and if there is a game is progress so other game is not started.

Like what @SHOCKWAVlN said just use something like a touched event to know if they are in there and then you could add them to a table or something and get the amount of objects in the table.

To do the game is in progress thing you could just make a variable so when the game starts make it true and at the end of the game make the variable equal to false. You then just do an if statement to view if there is a game currently on or not.

1 Like

Thanks ill give it a shot! (30)