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

> Se dispara del lado del cliente cuando una misión genera un ped, vehículo u objeto.

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

end)
```

### Parámetros

| Nombre | Tipo de dato | Descripción |
| - | - | - |
| `entityType` | string | `ped` / `vehicle` / `object` |
| `entity` | integer | El handle de la entidad |

## Ejemplo

```lua theme={null}
-- Solo un ejemplo que puedes editar para dar llaves a los vehículos generados
RegisterNetEvent("missions_creator:entitySpawned", function(entityType, entity)
    if(entityType == "vehicle") then
        local plate = GetVehicleNumberPlateText(entity)
        TriggerEvent("GIVEKEYS", plate)
    end
end)
```

<Note>
  Coloca este código en el archivo `jaksam_core/config/cl_config.lua`, al final del archivo en líneas nuevas.
</Note>


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