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

# Key cloning

> Thieves copy a car's key onto a blank key with a key programmer, and owners make the copies useless with Change lock

With **key cloning**, a thief sitting in a car plugs a **key programmer** under the dashboard and writes the car's code on a **blank key**. The copy works like a real key, days later too, **until the owner changes the lock**.

It is **off by default**.

## For the thief

**1. Get the tools**

You need a **Key programmer** (`key_programmer`) and a **Blank car key** (`blank_key`).

**2. Sit in the driver seat**

The car must be standing still.

**3. Use the programmer**

Use the key programmer from your inventory. The minigame opens.

**4. Play the 3 steps**

1. **PLUG**: **W A S D** move under the dashboard to find the port. The light blinks faster when you are close. Hold **E** to plug in
2. **READ**: **A** and **D** tune until the wave is clean. Hold **E** to read
3. **WRITE**: the code to write is on the screen. **W** and **S** pick each character, **E** writes it on the chip, one character at a time

**5. Take the copy**

You read "Key copied: you now have a copy of ...". The blank key is used up.

How long the copy works:

| Car | The copy works |
| - | - |
| A car owned by a player | Also after a restart, until the owner uses **Change the lock** |
| A car nobody owns | Until the next server restart |

With [keys as items](https://docs.jaksam-scripts.com/vehicles-keys/guides/keys-as-items.md) on, the copy is a key item and its description says it is a programmed copy.

### When it fails

* A wrong character only costs time ("Wrong character, burn it again"). On **hard** cars a wrong character, or losing the car's signal while reading, fails the copy
* Running out of time always fails the copy
* **The blank key is not lost** when a copy fails
* After a failed try the car's computer locks everybody out for a while: "The car's computer locked you out for 60 s"
* A failed try can set off the alarm
* After a few failed tries on the same car (3 by default) the minigame becomes a progress bar

### When it refuses

| Message | Why |
| - | - |
| Sit in the driver seat of the car to copy its key | Use it from the driver seat |
| Stop the car first | The car is moving |
| The key of this kind of car cannot be copied | The admin did not tick this vehicle class |
| Job vehicles cannot be copied | Keys of [job vehicles](https://docs.jaksam-scripts.com/vehicles-keys/guides/job-vehicles.md) can never be copied |
| Keys of players' cars cannot be copied here | The server allows only cars nobody owns |
| Only keys of players' cars can be copied here | The server allows only cars owned by players |
| You already own this car's key | It's your car |
| You need a blank key to write the copy on | No `blank_key` in your inventory |
| Not enough police in the city for this | The server needs more police online |

## For the owner

If your car has an [alarm](https://docs.jaksam-scripts.com/vehicles-keys/guides/alarms.md) of the level the admin chose (level 2 or more by default), you are warned while somebody programs a copy:

* A message: "Your alarm caught someone programming a key of ... Change the lock to make every copy useless"
* A mark on the map where the car is
* In your keys list, the key says **copied?** and shows the day and time of the warning

**1. Open the keys list**

Press **,** and click the key of your car.

**2. Change the lock**

Click **Change the lock and take back every copy**, then **Change the lock**.

Every copy stops working, the warning goes away, and your own key keeps working. See [Remote and keys list](https://docs.jaksam-scripts.com/vehicles-keys/guides/remote-and-keys-list.md#change-the-lock).

## For the admin

Open `/vehiclekeys` > **Settings** > **Key cloning** and tick **Thieves can copy a car's key onto a blank key with a key programmer**. Add the `key_programmer` and `blank_key` items to your inventory, see [Installation > Items](https://docs.jaksam-scripts.com/vehicles-keys/installation.md#items).

### Ready-made setups

| Setup | What it does |
| - | - |
| **Easy** | Every road car, no alarm on a failed try, 15 s lockout |
| **Balanced** | Sports and super cars of everybody, 25% alarm chance, 60 s lockout. These are the default values |
| **Rare and risky** | Only super cars of players, the programmer is used up too, 2 police needed online, 60% alarm chance |

A setup fills every field below, you can still change any of them. The label **Now:** tells which one your fields match.

### Options

| Option | What it does |
| - | - |
| Programmer item name | `key_programmer` by default |
| Blank key item name | `blank_key` by default |
| Which cars | Players' cars and cars nobody owns, only players' cars, or only cars nobody owns |
| How it plays | The key programmer minigame, or only a progress bar |
| Failed tries before the minigame turns into a progress bar | 3 by default |
| Progress bar length (seconds) | 10 by default |
| Chance a failed try sets off the alarm (%) | 25% by default |
| Seconds before anyone can try that car again after a failed try | 60 s by default |
| Police needed online (0 = none) | 0 by default |
| Warn the owner | Never, or from alarm level 2, 3 or 4. Level 2 by default |
| The programmer is used up too when a copy succeeds | Off by default. The blank key is always used up |
| Vehicle classes whose keys can be copied | Sports and Super by default. Shortcuts: **Same classes as Keyless entry**, **Super only**, **Sports + Super**, **Every car** |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.