---
title: "getcallingscript"
description: "Walks call frames looking for a non-nil script environment value."
---

```lua
getcallingscript(): Instance?
```

---

## Aliases

None.

---

## Arguments

This function takes no arguments.

---

## Returns

<ResponseField name="script" type="Instance?">
  The first non-nil script value found while walking caller environments, or nil.
</ResponseField>

Returns nil if no frame supplies script.

**Related types:** [Scripts types & behavior](/reference/scripts/types).

---

## Example

```lua
print(getcallingscript())
```
