# sm.melee.meleeAttack

Perform a melee attack

**Kind:** Function

**Environments:** Game

## Game

### Overload 1

``` { .lua .api-signature }
sm.melee.meleeAttack(
    name,
    damage,
    origin,
    directionRange,
    source,
    delay?,
    power?,
    ignoreCharacters
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.melee.md#meleeattack-string-integer-vec3-vec3-player-integer-optional-number-optional-table)

> **Deprecated:**
> Name is deprecated, use uuid instead
>

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the melee attack. |
| `damage` | integer | The damage the attack will inflict. |
| `origin` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The source position of the attack. |
| `directionRange` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction and reach of the attack. |
| `source` | [Player](../Game-Script-Environment/Userdata/Player.md) | The player that is the source of the attack. |
| `delay` *(optional)* | integer | The number of ticks before performing the attack. (Defaults to 0) |
| `power` *(optional)* | number | The strength of the knockback power. (Defaults to 5000) |
| `ignoreCharacters` | table | A table of characters to ignore in the attack. (optional) |

### Overload 2

``` { .lua .api-signature }
sm.melee.meleeAttack(
    name,
    damage,
    origin,
    directionRange,
    source,
    delay?,
    power?,
    ignoreCharacters
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.melee.md#meleeattack-string-integer-vec3-vec3-unit-integer-optional-number-optional-table)

> **Deprecated:**
> Name is deprecated, use uuid instead
>

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the melee attack. |
| `damage` | integer | The damage the attack will inflict. |
| `origin` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The source position of the attack. |
| `directionRange` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction and reach of the attack. |
| `source` | [Unit](../Game-Script-Environment/Userdata/Unit.md) | The unit that is the source of the attack. |
| `delay` *(optional)* | integer | The number of ticks before performing the attack. (Defaults to 0) |
| `power` *(optional)* | number | The strength of the knockback power. (Defaults to 5000) |
| `ignoreCharacters` | table | A table of characters to ignore in the attack. (optional) |

### Overload 3

``` { .lua .api-signature }
sm.melee.meleeAttack(
    uuid,
    damage,
    origin,
    directionRange,
    source,
    delay?,
    power?,
    ignoreCharacters
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.melee.md#meleeattack-uuid-integer-vec3-vec3-player-integer-optional-number-optional-table)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` | [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The uuid of the melee attack. |
| `damage` | integer | The damage the attack will inflict. |
| `origin` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The source position of the attack. |
| `directionRange` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction and reach of the attack. |
| `source` | [Player](../Game-Script-Environment/Userdata/Player.md) | The player that is the source of the attack. |
| `delay` *(optional)* | integer | The number of ticks before performing the attack. (Defaults to 0) |
| `power` *(optional)* | number | The strength of the knockback power. (Defaults to 5000) |
| `ignoreCharacters` | table | A table of characters to ignore in the attack. (optional) |

### Overload 4

``` { .lua .api-signature }
sm.melee.meleeAttack(
    uuid,
    damage,
    origin,
    directionRange,
    source,
    delay?,
    power?,
    ignoreCharacters
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.melee.md#meleeattack-uuid-integer-vec3-vec3-unit-integer-optional-number-optional-table)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` | [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The uuid of the melee attack. |
| `damage` | integer | The damage the attack will inflict. |
| `origin` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The source position of the attack. |
| `directionRange` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction and reach of the attack. |
| `source` | [Unit](../Game-Script-Environment/Userdata/Unit.md) | The unit that is the source of the attack. |
| `delay` *(optional)* | integer | The number of ticks before performing the attack. (Defaults to 0) |
| `power` *(optional)* | number | The strength of the knockback power. (Defaults to 5000) |
| `ignoreCharacters` | table | A table of characters to ignore in the attack. (optional) |
