# removeElementDataSubscriber (Server)

> Unsubscribes a player from an element data key. The player stops receiving that data's changes.

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

## Syntax

```lua
bool removeElementDataSubscriber(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 subscribed player. |

## Returns

`true` if the subscription was removed. `false` if the element has no data under that key or the player was not subscribed.

## Example

```lua
addCommandHandler("hidestats", function(player)
    removeElementDataSubscriber(player, "stats", player)
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.
- [hasElementDataSubscriber (Server)](https://wiki.mymp.gg/en/hasElementDataSubscriber.md): Tells whether a player is subscribed to an element data key.
- [setElementData (Server)](https://wiki.mymp.gg/en/setElementData-server.md): Keeps a piece of data on an element and, depending on sync, sends it to the players.
