# llGetScriptName

*LSL function*

```lsl
string string llGetScriptName();
```

- Returns: `string`
- Energy: 10

Returns a [string](https://wiki.secondlife.com/wiki/string) that is the name of the script that called this function.

```lsl title="How to use" frame="terminal"
string result = llGetScriptName();
```

## Examples

<details open>
<summary>Remove the current script from the object</summary>

```lsl
default
{
    state_entry()
    {
        llRemoveInventory(llGetScriptName());
    }
}
```

</details>

## Known issues

- [SVC-388](https://jira.secondlife.com/browse/SVC-388): [llGetScriptName](/functions/llGetScriptName/) returns script's old name

---

From lsl.dev: https://lsl.dev/functions/llGetScriptName/
