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

# On entity spawn

> Triggered client side when a mission spawns a ped, vehicle, or object.

```lua Event theme={null}
RegisterNetEvent("missions_creator:entitySpawned", function(entityType, entity)

end)
```

### Parameters

| Name         | Data Type | Description                  |
| ------------ | --------- | ---------------------------- |
| `entityType` | string    | `ped` / `vehicle` / `object` |
| `entity`     | integer   | The entity's handle          |

## Example

```lua theme={null}
-- Just an example you can edit to give keys to spawned vehicles
RegisterNetEvent("missions_creator:entitySpawned", function(entityType, entity)
    if(entityType == "vehicle") then
        local plate = GetVehicleNumberPlateText(entity)
        TriggerEvent("GIVEKEYS", plate)
    end
end)
```

<Note>
  Place this code in the file `jaksam_core/config/cl_config.lua`, at the bottom of the file on new lines.
</Note>


## Related topics

- [Client](/missions-creator/client/index.md)
- [On test drive vehicle spawn](/dealerships-creator/client/on-test-drive-vehicle-spawn.md)
- [Get door ID from entity](/doors-creator/client/get-door-id-from-entity.md)
- [Vehicle spawned](/jobs-creator/client/garage-owned/vehicle-spawned.md)
