Skip to content
ts
function exit(reason?: string): void;

Exits early from the script execution, useful to bail out based on certain conditions.

Parameters

ParameterTypeDescription
reason?stringOptional reason for why the script failed, shows up in the console area.

Example

ts
if (player.isDead) {
  exit("Failed, I'm dead!");
}