> For the complete documentation index, see [llms.txt](https://stalk.gitbook.io/documentation-stalk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stalk.gitbook.io/documentation-stalk/clone-appareance/installation-guide.md).

# Installation Guide

The installation process for **STALK Clone** has been designed to be quick and simple to set up on your server.

`stalk_clone` is an NPC and player clone management system that allows administrators to create static NPCs, clone online players, save NPCs permanently, configure animations, attach props, and manage everything through a modern NUI menu.

Most of the configuration can be modified directly through the `config.lua` file.

***

## Step 1 : Resource Installation

Start by dragging the `stalk_clone` folder into your server’s `resources` directory.

Once the folder has been added, open your `server.cfg` file and add the following line:

```
ensure stalk_clone
```

After saving the changes, restart your server.

***

## Step 2 : Required Dependencies

Before starting the resource, make sure the following dependency is correctly installed on your server:

```
oxmysql
```

The script uses `oxmysql` to save created NPCs permanently in your database.

***

## Step 3 : Database Installation

The resource includes an SQL file located here:

```
stalk_clone/sql/talk_mpc.sql
```

Import this SQL file into your database using phpMyAdmin, HeidiSQL, or any MySQL manager.

The table used by the script is:

```
talk_mpc
```

This table stores all created NPCs, cloned players, positions, animations, props, and saved data.

***

## Step 4 : Main Configuration

All main configuration settings are located inside:

```
stalk_clone/config.lua
```

From this file, you can configure admin permissions, spawn distances, cloned NPC defaults, appearance providers, menu command, menu keybind, placement settings, and animation presets.

***

## Step 5 : Admin Permissions

The menu is protected by admin permissions by default.

The script supports ACE permissions:

```
Config.AdminAce = "talk_mpc.admin"Config.AdminAllowAce = true
```

To give access to an admin group, add this line to your `server.cfg`:

```
add_ace group.admin talk_mpc.admin allow
```

You can also whitelist specific licenses directly in the config:

```
Config.AdminLicenses = {    "license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",}
```

If you want everyone to access the menu, you can disable the admin requirement:

```
Config.RequireAdminToOpen = false
```

This is not recommended for public servers.

***

## Step 6 : Menu Command

The NPC menu can be opened with the configured command.

By default, the command is:

```
Config.MenuCommand = "npc"
```

Players with permission can open the menu using:

```
/npc
```

You can rename the command if you want it to match your server style.

***

## Step 7 : Optional Menu Keybind

The script also supports an optional keybind.

By default, it is disabled:

```
Config.MenuKey = ""
```

If you want to open the menu with a key, you can set one like this:

```
Config.MenuKey = "F6"
```

Leaving the value empty disables the keybind.

***

## Step 8 : Spawn & Streaming Configuration

The script uses a distance-based spawning system to keep the resource optimized.

Default settings:

```
Config.SpawnDistance = 80.0Config.DespawnDistance = 110.0Config.TickMs = 500
```

NPCs will spawn when players are close enough and despawn when they move too far away.

You can increase or decrease these values depending on your server performance and map size.

***

## Step 9 : Static NPC Configuration

You can manually create static NPCs inside the config.

Example:

```
Config.StaticMPC = {    {        id = "welcome_guard",        coords = vec4(-1037.2, -2737.8, 20.1, 330.0),        model = "s_m_m_security_01",        scenario = nil,        anim = {            dict = "amb@world_human_guard_stand@male@base",            name = "base",            flag = 1        },        frozen = true,        invincible = true,        blockEvents = true,        label = "Welcome Guard"    }}
```

Static NPCs are spawned for everyone and do not need to be created from the menu.

***

## Step 10 : Cloned NPC Defaults

Default behavior for cloned NPCs can be configured here:

```
Config.ClonedNPC = {    frozen = true,    invincible = true,    blockEvents = true,    labelPrefix = "CLONE"}
```

These values control whether cloned NPCs are frozen, invincible, protected from events, and how their default labels are generated.

***

## Step 11 : Appearance Providers

The script can automatically detect supported appearance systems to clone player skins.

Default supported providers:

```
Config.AppearanceProviders = {    {        name = "17mov_CharacterSystem",        resource = "17mov_CharacterSystem",        getFns = { "GetPedAppearance", "getPedAppearance", "GetAppearance", "getAppearance", "GetSkin", "getSkin" },        setFns = { "SetPedAppearance", "setPedAppearance", "SetAppearance", "setAppearance", "SetSkin", "setSkin" }    },    {        name = "illenium-appearance",        resource = "illenium-appearance",        getFns = { "getPedAppearance" },        setFns = { "setPedAppearance" }    },    {        name = "fivem-appearance",        resource = "fivem-appearance",        getFns = { "getPedAppearance" },        setFns = { "setPedAppearance" }    }}
```

If your server uses another appearance system, you can add a new provider by specifying the resource name and the export functions used to get and apply appearances.

***

## Step 12 : Placement Configuration

The script includes placement helpers to position NPCs accurately in-game.

Default settings:

```
Config.Placement = {    rayDistance = 25.0,    step = 0.05,    rotateStep = 2.0}
```

`rayDistance` controls the placement detection distance. `step` controls movement precision during placement mode, and `rotateStep` controls the rotation speed in degrees.

***

## Step 13 : Animation Presets

The menu includes animation presets that can automatically fill scenario or animation fields.

Example:

```
Config.AnimationPresets = {    { label = "Aucune", type = "none" },    { label = "Garde (stand)", type = "scenario", scenario = "WORLD_HUMAN_GUARD_STAND" },    { label = "Impatient", type = "scenario", scenario = "WORLD_HUMAN_STAND_IMPATIENT" },    { label = "Fumer", type = "scenario", scenario = "WORLD_HUMAN_SMOKING" },    { label = "Pose (base)", type = "anim", dict = "amb@world_human_guard_stand@male@base", name = "base", flag = 1 },    { label = "Bras croisés", type = "anim", dict = "amb@world_human_hang_out_street@male_c@base", name = "base", flag = 1 }}
```

You can add your own scenarios or animation dictionaries to make NPC creation faster from the menu.

***

## Step 14 : Creating A Cloned Player NPC

To create a cloned player NPC, open the menu with:

```
/npc
```

Select an online player from the player list, choose a label if needed, configure the scenario, animation, prop, and NPC options, then place the clone in the world.

Once saved, the clone will be stored in the database and automatically loaded after server restart.

***

## Step 15 : Creating A Simple NPC

The menu also allows you to create a simple NPC without cloning an online player.

You can choose the ped model, display name, animation, scenario, attached prop, position, and protection options.

This is useful for creating guards, shopkeepers, welcome NPCs, event characters, or decorative NPCs.

***

## Step 16 : Attached Props

Both cloned NPCs and simple NPCs can use attached props.

You can configure the prop model, bone, offset, and rotation directly from the menu.

Example prop values:

```
Model: prop_cs_burger_01Bone: 57005
```

Advanced offset and rotation settings allow precise placement on the NPC body.

***

## Step 17 : NPC Management

The NUI menu allows administrators to refresh the list, edit existing NPCs, delete saved NPCs, and update their data.

All saved NPCs are synchronized to players and stored permanently in the database.

***

## Important

Before updating the resource or modifying important settings, we strongly recommend creating a full backup of your server and database.

Even though the script is optimized and easy to configure, backups remain essential to avoid issues caused by incorrect configuration, missing dependencies, database errors, or external conflicts.

***

## AI / Documentation Queries

If some information is not directly available on this page, you can dynamically query the documentation using the `ask` parameter.

Example:

```
GET https://docs.stalk.dev/stalk-clone/installation-guide.md?ask=<your-question>
```

You can ask questions such as how to add a static NPC, how to clone a player, how to configure admin access, how to add new animation presets, how to whitelist licenses, or how to change spawn distances.

The system will automatically return a direct answer along with the most relevant documentation sections.
