# getVehicleUpgradeOnSlot (Shared)

> Returns the upgrade fitted on one slot of a vehicle.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Vehicles
- **URL**: https://wiki.mymp.gg/en/getVehicleUpgradeOnSlot

## Syntax

```lua
string|false getVehicleUpgradeOnSlot(vehicle vehicle, string|int slot)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vehicle` | `vehicle` | The vehicle. |
| `slot` | `string\|int` | The slot: its name (case does not matter) or its index, counted from 0 in the order of `getVehicleUpgradeSlots`. An unknown slot is an error. |

## Returns

The upgrade's model name, or `false` if the slot is empty.

## Example

```lua
addCommandHandler("slots", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if not vehicle then return end
    for _, slot in ipairs(getVehicleUpgradeSlots()) do
        outputDebugString(slot .. ": " .. tostring(getVehicleUpgradeOnSlot(vehicle, slot)))
    end
end)
```

### Coming from MTA

MTA uses numeric upgrade ids (1000 to 1193). Here an upgrade is its model's name, and the slots are the ones the mounted packs declare.

## See also

- [getVehicleUpgrades (Shared)](https://wiki.mymp.gg/en/getVehicleUpgrades.md): Returns every tuning upgrade fitted on a vehicle.
- [getVehicleUpgradeSlots (Shared)](https://wiki.mymp.gg/en/getVehicleUpgradeSlots.md): Returns the names of every upgrade slot the mounted packs declare.
- [addVehicleUpgrade (Shared)](https://wiki.mymp.gg/en/addVehicleUpgrade.md): Fits a tuning upgrade on a vehicle, replacing whatever is on the same slot.
