# hasElementDataSubscriber (Server)

> Tells whether a player is subscribed to an element data key.

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

## Syntax

```lua
bool hasElementDataSubscriber(element element, string key, player player)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `element` | The element holding the data. |
| `key` | `string` | The data's key. Keys longer than 128 characters are cut, with a warning. |
| `player` | `player` | The player to check. |

## Returns

`true` if the player is subscribed to that key, `false` otherwise.

## Example

```lua
local function watchMoney(player, target)
    if not hasElementDataSubscriber(target, "money", player) then
        addElementDataSubscriber(target, "money", player)
    end
end
```

## See also

- [addElementDataSubscriber (Server)](https://wiki.mymp.gg/en/addElementDataSubscriber.md): Subscribes a player to an element data key set with the "subscribe" sync mode. The player receives the current value at once and every change after that.
- [removeElementDataSubscriber (Server)](https://wiki.mymp.gg/en/removeElementDataSubscriber.md): Unsubscribes a player from an element data key. The player stops receiving that data's changes.
