bitburner-src/markdown/bitburner.ns.kill_1.md

40 lines
896 B
Markdown
Raw Normal View History

2021-10-30 18:34:14 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [kill](./bitburner.ns.kill_1.md)
## 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.
<b>Signature:</b>
```typescript
kill(scriptPid: number): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| scriptPid | number | PID of the script to kill |
<b>Returns:</b>
boolean
True if the script is successfully killed, and false otherwise.
## Remarks
2021-10-30 21:46:34 +02:00
RAM cost: 0.5 GB
2021-10-30 18:34:14 +02:00
## Example
2021-10-30 21:46:34 +02:00
```ts
2021-10-30 18:34:14 +02:00
if (kill(10)) {
print("Killed script with PID 10!");
}
```