# AreaTrigger.bindOnMelee

Bind the lua function to be used when the area trigger is hit by a melee attack.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
areaTrigger:bindOnMelee( callback, object? )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/AreaTrigger.md#bindonmelee)

**Availability:** Server only

Requires that areaTriggerProxyType has been set to [sm.areaTrigger.areaTriggerProxyType.melee](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#areatriggerproxytype)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `areaTrigger` | [AreaTrigger](../Game-Script-Environment/Userdata/AreaTrigger.md) | The area trigger instance. |
| `callback` | string | The name of the Lua function to bind. |
| `object` *(optional)* | table | The object that will receive the callback. (optional) |
