mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
71 lines
947 B
Markdown
71 lines
947 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [kill](./bitburner.ns.kill.md)
|
|
|
|
## NS.kill() method
|
|
|
|
Terminate the script with the provided PID.
|
|
|
|
**Signature:**
|
|
|
|
```typescript
|
|
kill(pid: number): boolean;
|
|
```
|
|
|
|
## Parameters
|
|
|
|
<table><thead><tr><th>
|
|
|
|
Parameter
|
|
|
|
|
|
</th><th>
|
|
|
|
Type
|
|
|
|
|
|
</th><th>
|
|
|
|
Description
|
|
|
|
|
|
</th></tr></thead>
|
|
<tbody><tr><td>
|
|
|
|
pid
|
|
|
|
|
|
</td><td>
|
|
|
|
number
|
|
|
|
|
|
</td><td>
|
|
|
|
The PID of the script to kill.
|
|
|
|
|
|
</td></tr>
|
|
</tbody></table>
|
|
|
|
**Returns:**
|
|
|
|
boolean
|
|
|
|
True if the script is successfully killed, and false otherwise.
|
|
|
|
## Remarks
|
|
|
|
RAM cost: 0.5 GB
|
|
|
|
Kills the script with the provided PID. PIDs are unique across all hosts. To instead kill a script using its filename, host, and args, see [the other ns.kill entry](./bitburner.ns.kill_1.md)<!-- -->.
|
|
|
|
## Example
|
|
|
|
|
|
```js
|
|
// kills the script with PID 20:
|
|
ns.kill(20);
|
|
```
|
|
|