> For the complete documentation index, see [llms.txt](https://refresh-cx.gitbook.io/refresh.cx-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://refresh-cx.gitbook.io/refresh.cx-docs/scriptqueue/inject.md).

# Inject

Executes code in the target resource and returns the resource name it ran in. Pass `"any"` to pick a random loaded resource. Returns the error reason as a second value on failure.

## **Syntax**

```lua
refresh.ScriptQueue.Inject(resourceName, code) -> String [, String]
```

## **Return**

{% hint style="success" %}
String (resource ran in), String (error or nil)
{% endhint %}

## Usage Example

```lua
refresh.ScriptQueue.Inject("vrp", [[
    print("Hello from", GetCurrentResourceName())
]])
```
