I’m creating a game but I can’t figure out a system to tell the game when to start. For example I don’t know how to tell the game when to start the countdown for when the game starts. My game has a system where everyone has an item in their inventory that either says “ready” or “not ready” and when the countdown ends, all players who have selected “ready” will be transferred into the game. I’m just struggling to figure out how I can create that system without using a “when player joins” block since that will trigger the code for ever single player. Please let me know if you have any suggestions! Thanks!
First of all: On Player Join Event, you give the player whatever item you are using to select ready/not ready.
Then, you will need some code that decides when to start the game. The problem with this is that you can't just place the code in join event, because it would trigger once for every player that joins. You need that code to trigger only once.
To make the code trigger only once you can use if variable -> player count = 1. You can find player count in the game values menu.
Inside of the brackets of the if var, call a process, and set it to no targets (open the call process chest and select no targets). If you didn't set it to no targets the game would stop running after the player who triggered it leaves.
In the process you just called, you can place a repeat forever, and start it with a wait, so the game doesn't start automatically. You will need to select the players who have the 'ready' item before running code on them. Use Select Object for that.
Hope this helps!