# engineSetMaterialAlphaClip (Client)

> Makes the material cut out pixels whose alpha is below a threshold, or stop cutting out.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Materials and shaders
- **URL**: https://wiki.mymp.gg/en/engineSetMaterialAlphaClip

## Syntax

```lua
bool engineSetMaterialAlphaClip(material material, float|false|nil clip)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `material` | `material` | The material. |
| `clip` | `float\|false\|nil` | The alpha threshold, from 0 to 1. `false` turns cutting out off. `nil` follows the base again. |

## Returns

`true` when it was set.

## Example

```lua
local leaves = engineCreateMaterial()
engineSetMaterialAlphaClip(leaves, 0.4)
engineSetWorldMaterial("*leaves*", leaves)
```

### Note

A number outside 0..1 is an error, and so is `true`.

## See also

- [engineGetMaterialAlphaClip (Client)](https://wiki.mymp.gg/en/engineGetMaterialAlphaClip.md): Gives whether the material cuts pixels out by their alpha, and below which alpha.
- [engineSetMaterialValue (Client)](https://wiki.mymp.gg/en/engineSetMaterialValue.md): Sets a material's value: a shader parameter, a static switch or the render target of a TARGET_n output.
