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

# Signals

> Legitbot notifications: shots, targets, scope, magnet.

Call `:Connect(callback)`. Connections clean up automatically on script unload.

| Signal              | Your callback receives                           |
| ------------------- | ------------------------------------------------ |
| `onShotFired`       | `(event)`: every time the triggerbot fires       |
| `onTargetAcquired`  | `(event)`: aim locked onto someone new           |
| `onTargetLost`      | `(event)`: aim let go of its target              |
| `onTriggerArmed`    | `(event)`: triggerbot lined up and ready to fire |
| `onTriggerDisarmed` | `()`: triggerbot no longer ready                 |
| `onScopeChanged`    | `(scope)`: active settings scope changed         |
| `onMagnetPull`      | `(event)`: aim assist pulled your aim            |

Payload types: [ShotEvent](/reference/types#shotevent), [TargetEvent](/reference/types#targetevent), [TriggerEvent](/reference/types#triggerevent), [MagnetEvent](/reference/types#magnetevent).

## Examples

```luau theme={null}
-- Log the last 5 shots
local log = {}
api.legitbot.onShotFired:Connect(function(event)
    table.insert(log, 1, {
        name = event.player and event.player.Name,
        hitbox = event.hitbox,
        dmg = event.predictedDamage,
    })
    log[6] = nil
end)

-- Branch on the active scope
api.legitbot.onScopeChanged:Connect(function(scope)
    if scope == "weapon:ak47" then
        -- crank the magnet
    end
end)
```
