> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vampauth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scripts

> Upload scripts, link many to one project, and share loadstring URLs with or without a baked-in key check.

export const CopyPrompt = () => {
  const [copied, setCopied] = useState(false);
  const prompt = "Explain Vampauth Scripts in 12 lines: script slots (20 free / 50 developer), many scripts per project, per-script loadstring URLs /api/projects/<id>/scripts/<alias>, legacy /loadstring.lua serving the primary (earliest) script only, SDK mode 'vampauth' (launcher injected, snippet ships getgenv().script_key) vs 'custom' (no injection, you call the API yourself), and InvalidAction console mode. No code.";
  const copy = async () => {
    try {
      await navigator.clipboard.writeText(prompt);
    } catch {
      const t = document.createElement("textarea");
      t.value = prompt;
      document.body.appendChild(t);
      t.select();
      document.execCommand("copy");
      document.body.removeChild(t);
    }
    setCopied(true);
    setTimeout(() => setCopied(false), 1500);
  };
  return <div className="not-prose my-4 flex items-center justify-between gap-3 rounded-lg border border-zinc-200 px-4 py-2.5 dark:border-zinc-800">
      <span className="text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400">AI prompt</span>
      <button onClick={copy} className="cursor-pointer rounded border border-zinc-300 px-2.5 py-1 text-xs font-semibold text-zinc-700 hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800">{copied ? "Copied" : "Copy"}</button>
    </div>;
};

# Scripts

Scripts are the files your users run. Each script lives in your Scripts library, is linked to a project, and gets its own loadstring URL.

## Slots and linking

| Plan      | Script slots |
| --------- | ------------ |
| Free      | 20           |
| Developer | 50           |

Slots are account-wide, not per-project: **multiple scripts can share one project**. Every script must be linked to a project — the key check is tied to the project's credentials.

## Loadstring URLs

Every script gets its own URL, named by its alias (lowercase letters, numbers, `-`, `_`):

```
https://vampauth.com/api/projects/<project_id>/scripts/<alias>
```

URLs only respond to in-game clients — browser requests get a blocked page. Responses are cached briefly at the edge; changes can take up to a minute to propagate.

### Legacy URLs

Two older URL formats still work and always serve the project's **primary** script — the first script linked to the project, marked *Primary* in the dashboard:

* `https://vampauth.com/api/projects/<project_id>/loadstring.lua`
* `https://vampauth.com/api/projects/<project_id>/scripts/<scriptId>/raw`

If a project has multiple scripts, point users at each script's own URL. Legacy URLs keep working so published loadstrings never break.

## SDK modes

Choose how the key check reaches your users when saving a script:

| Mode                       | What happens                                                                                                                      | Snippet to share                            |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| **Vampauth SDK** (default) | The launcher is baked into the served build. It validates the key against Vampauth before running your code.                      | `getgenv().script_key = "..."` + loadstring |
| **Custom SDK**             | The served build is never touched — obfuscated or raw, exactly what you uploaded. You implement key checks in-script via the API. | plain loadstring                            |

## The snippet

Scripts dashboard cards show a ready-to-share snippet:

```lua theme={null}
getgenv().script_key = "PASTE-KEY-HERE"
loadstring(game:HttpGet("https://vampauth.com/api/projects/<id>/scripts/<alias>"))()
```

Users replace `PASTE-KEY-HERE` with a key from the checkpoint flow or your dashboard. For scripts without the SDK injected (custom mode, or no injection), the plain one-liner is enough:

```lua theme={null}
loadstring(game:HttpGet("https://vampauth.com/api/projects/<id>/scripts/<alias>"))()
```

## Launcher options

Vampauth SDK scripts read an optional config table before running:

```lua theme={null}
getgenv().config = {
  InvalidAction = "kick",  -- "kick" | "console" | "silent"
  KickMessage = "...",     -- custom kick text (kick mode only)
  Debug = true,            -- verbose [vampauth] prints
  DisableChecks = true,    -- run without validation (not recommended)
}
```

`InvalidAction` decides what happens when validation fails:

* **kick** (default) — the player is kicked with the kick message.
* **console** — prints `[Vampauth] <reason>` to the console. The script never runs and the player is not kicked.
* **silent** — nothing visible; the script never runs.

The script never runs on a failed check in any mode.

<CopyPrompt id="scripts" />
