> ## Documentation Index
> Fetch the complete documentation index at: https://luau.limerence.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Apocalypse Rising 2

> AR2-only local-player calls: held item, hydration, energy, vehicle, and inventory.

**Apocalypse Rising 2 only.** Guard with `if api.client.x then` before calling on other games.

## Getters

| Call              | Returns   | What it tells you                                                                    |
| ----------------- | --------- | ------------------------------------------------------------------------------------ |
| `getItem()`       | `string?` | The name of whatever you're holding, same as `getItemName()`. `nil` if empty-handed. |
| `getHydration()`  | `number`  | Your current hydration.                                                              |
| `getEnergy()`     | `number`  | Your current energy.                                                                 |
| `isThirdPerson()` | `boolean` | `true` while in third person.                                                        |
| `getVehicle()`    | `Model?`  | The vehicle you're in, or `nil`.                                                     |

AR2 notes: `getMaxHealth()` is always `100` (the game's base) and `getHealthFraction()` is relative to that. `isSpectating()` is always `false`. `getTeam()` reflects the local team string only. `onKill` is not available in AR2 — only `onHit`.

## Inventory

Read your gear and nearby loot, then move items around. Item ids come from the read calls; pass an item's `id` to the action calls. These are the same moves you can do by hand, so the server still enforces space, valid slots, and so on.

| Call                              | Returns    | What it gives you                                                                           |
| --------------------------------- | ---------- | ------------------------------------------------------------------------------------------- |
| `getItems()`                      | `{ Item }` | Everything in your carried containers.                                                      |
| `getNearbyLoot()`                 | `{ Item }` | Items in open bodies / containers / ground nearby (each also has `container` and `source`). |
| `getEquipment()`                  | `{ Item }` | Your equipped gear, each tagged with `equipSlot`.                                           |
| `equipItem(id, slot?)`            |            | Equip an item (optionally into a specific slot).                                            |
| `useItem(id)`                     |            | Use / consume an item (heal, eat, drink).                                                   |
| `dropItem(id, rotated?)`          |            | Drop an item to the ground.                                                                 |
| `pickupItem(id, containerId?)`    |            | Pick up loot. The container is found for you if omitted.                                    |
| `craftItem(id, sourceId)`         |            | Combine `sourceId` into `id` (top up a mag / ammo box).                                     |
| `fillAmmo(id)`                    |            | Fill a magazine from your loose ammo.                                                       |
| `unloadAmmo(id)`                  |            | Unload a magazine into loose ammo.                                                          |
| `slotUtility(id)`                 |            | Slot a utility (flashlight, binoculars, etc.).                                              |
| `removeAttachment(id, parentId?)` |            | Detach an attachment. The parent is found for you if omitted.                               |

See [Item](/reference/types#client-types).

## Examples

```luau theme={null}
-- Use the first medkit in your bag
for _, item in api.client.getItems() do
    if item.name == "Medkit" then
        api.client.useItem(item.id)
        break
    end
end

-- Grab every nearby gun
for _, item in api.client.getNearbyLoot() do
    if item.type == "Firearm" then
        api.client.pickupItem(item.id, item.container)
    end
end
```
