2021-10-30 18:34:14 +02:00
<!-- 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
2021-11-03 23:16:10 +01:00
Terminate another script.
2021-10-30 18:34:14 +02:00
< b > Signature:< / b >
```typescript
2022-01-08 19:25:06 +01:00
kill(script: number): boolean;
2021-10-30 18:34:14 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2022-01-08 19:25:06 +01:00
| script | number | Filename or pid of the script to kill |
2021-10-30 18:34:14 +02:00
< 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
2021-11-03 23:16:10 +01:00
Kills the script on the target server specified by the script’ s name and arguments. Remember that scripts are uniquely identified by both their name and arguments. For example, if `foo.script` is run with the argument 1, then this is not the same as `foo.script` run with the argument 2, even though they have the same code.
2021-10-30 18:34:14 +02:00
## Example 1
2021-10-30 21:46:34 +02:00
```ts
2022-01-08 19:25:06 +01:00
// NS1:
2021-10-30 18:34:14 +02:00
//The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:
kill("foo.script", "foodnstuff");
//The following will try to kill a script named foo.script on the current server that was ran with no arguments:
kill("foo.script", getHostname());
2022-01-08 19:25:06 +01:00
//The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:
kill("foo.script", getHostname(), 1, "foodnstuff");
2021-10-30 18:34:14 +02:00
```
2022-01-08 19:25:06 +01:00
## Example 2
2021-10-30 18:34:14 +02:00
2021-10-30 21:46:34 +02:00
```ts
2022-01-08 19:25:06 +01:00
// NS2:
//The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:
ns.kill("foo.script", "foodnstuff");
//The following will try to kill a script named foo.script on the current server that was ran with no arguments:
ns.kill("foo.script", getHostname());
2021-10-30 18:34:14 +02:00
//The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:
2022-01-08 19:25:06 +01:00
ns.kill("foo.script", getHostname(), 1, "foodnstuff");
2021-10-30 18:34:14 +02:00
```