Event<T...>
Something that happens in the game, such as a player joining, which your scripts listen to with connect or wait.
Something that happens in the game, such as a player joining, which your scripts listen to with connect or wait.
Runs your function every time the event fires, each time in a new thread.
door.touched:connect(function(part, player) print("touched") end, { debounce = 1 })Use it forreacting to a player touching a token, joining, or any other event.
callbackRuns at each firing, with the event's values.optionsoptionalDebounce, per player, once and a filter.connect calldebounce · per_player · once · filterdebounceHow many seconds after each run that new firings are skipped, which can be 0 or more.
per_playerWhether each player gets their own debounce, while a firing without a Player uses the shared one.
onceSet it to true to disconnect after the first run, so the function only runs once.
filterA function that gets the event's values and returns whether this firing counts, and a firing that doesn't count, or whose filter errors, never uses up once or debounce.
Pauses the script until the event fires next, then gives you its values.
local newcomer = players.joined:wait()Use it forwaiting for the first player to join before the game starts its first round.