Event:connect
method#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.Build a connect calldebounce · per_player · once · filter
debounceHow 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
trueto 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
onceordebounce.