bitburner-src/markdown/bitburner.ns.kill_1.md
Olivier Gagnon feb0430aff work on doc
2021-10-30 15:46:34 -04:00

896 B

Home > bitburner > NS > kill

NS.kill() method

Kills the script with the specified PID. Killing a script by its PID will typically have better performance, especially if you have many scripts running. If this function successfully kills the specified script, then it will return true. Otherwise, it will return false.

Signature:

kill(scriptPid: number): boolean;

Parameters

Parameter Type Description
scriptPid number PID of the script to kill

Returns:

boolean

True if the script is successfully killed, and false otherwise.

Remarks

RAM cost: 0.5 GB

Example

if (kill(10)) {
    print("Killed script with PID 10!");
}