# getElementAlpha (Shared)

> Reads an element's alpha, from 0 (invisible) to 255 (opaque).

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Elements
- **URL**: https://wiki.mymp.gg/en/getElementAlpha

## Syntax

```lua
int|false getElementAlpha(element element)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `element` | The element to read. |

## Returns

The alpha, or `false` if the element has none.

## Example

```lua
if getElementAlpha(localPlayer) < 255 then
    setElementAlpha(localPlayer, 255)
end
```

## See also

- [setElementAlpha (Shared)](https://wiki.mymp.gg/en/setElementAlpha.md): Sets the transparency of an element and of all its children.
