Player Connection - Freeze/Unfreeze (Effect) — SkBee
Addon: SkBee · Category: Effect · Since: 3.16.0
Syntax
freeze connection %playerconnection/audience% [with timeout message %-textcomp%]Description
Freeze/unfreeze a player connect. **FREEZING**: You can freeze a player connection in the async player connection configure event. There is a built in 2 minute timeout just incase you don't handle unfreezing the connection. There is an optional timeout message (Will default to "Timeout"). This will freeze the thread, so make sure to run it last.
**UNFREEZING**: You can unfreeze the connection with an option to disconnect. If not disconnecting, the player will join the server after the connection is unfrozen. This can be done in the async player connection configure event and the player custom click event.
Examples
on async player connection configure:
# open your dialog
openDialog(event-audience)
# Freeze the connection and wait for the player to respond
freeze connection event-playerconnection
on player custom click:
if event-namespacedkey contains "custom:accept_rules":
# Unfreeze the connection and join the player to the server if they accept rules
unfreeze connection event-playerconnection
if event-namespacedkey contains "custom:decline_rules":
# Unfreeze the connection and kick the player if they decline the rules
unfreeze connection event-playerconnection and disconnect due to mini message from "<red>You decided to leave!"