> ## 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 cloned

> Triggered server side when a thief copies a car's key with the key programmer.

Triggered when a thief finishes a copy with the [key programmer](https://docs.jaksam-scripts.com/vehicles-keys/guides/key-cloning.md). The blank key is already used up and the copy is already given.

```lua Event theme={null}
AddEventHandler("vehicles_keys:keyCloned", function(playerId, plate, vehicleNetId, isItem)

end)
```

### Parameters

| Name | Data Type | Description |
| - | - | - |
| `playerId` | integer | Server ID of the thief |
| `plate` | string | Plate of the car, trimmed and in upper case |
| `vehicleNetId` | integer | Network ID of the car |
| `isItem` | boolean | `true`: the copy is a key item ([keys as items](https://docs.jaksam-scripts.com/vehicles-keys/guides/keys-as-items.md) on). `false`: a virtual key |

## Example

```lua theme={null}
AddEventHandler("vehicles_keys:keyCloned", function(playerId, plate, vehicleNetId, isItem)
    print(GetPlayerName(playerId) .. " copied the key of " .. plate .. (isItem and " (key item)" or " (virtual key)"))
end)
```

> [!NOTE]
>
> A copy of a player's car works until the owner changes the lock. A copy of a car nobody owns works until the next restart.


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