> ## 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 api.game: world pings, your squad, and zombies.

**Apocalypse Rising 2 only.** World-level interaction, your squad, and zombies. (Your inventory lives on `api.client`: see the [AR2 client section](/client/apocalypse-rising-2) for `getItems`, `equipItem`, `useItem`, and the rest.)

## Methods

| Call                  | What it does                                                 |
| --------------------- | ------------------------------------------------------------ |
| `ping(position)`      | Drop a world ping at a `Vector3`.                            |
| `pingPlayer(player)`  | Drop a world ping on a player's current position.            |
| `clearPing()`         | Clear your world ping.                                       |
| `getSquad()`          | Returns the `Player`s in your squad. Empty when you're solo. |
| `isSquadmate(player)` | Returns whether a player is in your squad.                   |
| `getZombies()`        | Returns the zombie `Model`s currently in the world.          |

## Signals

Call `:Connect(callback)` on these. They get cleaned up when your script unloads.

| Signal            | Your callback receives                                                         |
| ----------------- | ------------------------------------------------------------------------------ |
| `onSquadChanged`  | `()`: someone joined or left your squad. Read `getSquad()` for the new roster. |
| `onZombieAdded`   | `(zombie: Model)`: a zombie spawned.                                           |
| `onZombieRemoved` | `(zombie: Model)`: a zombie despawned or died.                                 |

## Example

```luau theme={null}
-- Ping the nearest enemy
local target = api.legitbot.getTarget()
if target then
    api.game.pingPlayer(target.player)
end

-- Squad roster pill
api.game.onSquadChanged:Connect(function()
    api.ui.toast(`Squad: {#api.game.getSquad()} members`)
end)
```
