> For the complete documentation index, see [llms.txt](https://nelo-scripts.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nelo-scripts.gitbook.io/home/esx/group-tablet/how-to/2.-sync-members/client-and-server.md).

# Client and Server

The basics of client and server event synchronization.

***

In the practical example below, we show how to synchronize the event for members of a <mark style="color:blue;">**Client**</mark>~~**(or Server)**~~**&#x20;**<mark style="color:blue;">**Event.**</mark>

> <mark style="color:red;">**Remember**</mark> that, regardless of whether it's an event to be synchronized on the server or client, we always have the same step-by-step process.

{% tabs %}
{% tab title="Client" %}

```lua
RegisterNetEvent('--:client:SendData')
AddEventHandler('--:client:SendData', function()
    Data = {
        value1 = ?,
        value2 = ?,
        value3 = ?
    }
TriggerServerEvent('--:server:GroupEvent', GroupID, "client", 'client event here', {Data})
end)
```

Now, let's explain in more depth what happens with each segment.

[<mark style="color:red;">TriggerServerEvent('--:server:GroupEvent'</mark>](#user-content-fn-1)[^1],

[ <mark style="color:blue;">GroupID</mark>](#user-content-fn-2)[^2],

[<mark style="color:yellow;">"client"</mark>](#user-content-fn-3)[^3],&#x20;

['client event here'](#user-content-fn-4)[^4],&#x20;

[<mark style="color:purple;">{Data}</mark>](#user-content-fn-5)[^5])

> <mark style="color:green;">**Click on**</mark> each step to better understand your guide.
> {% endtab %}

{% tab title="Server" %}

```lua
-- #GROUP EVENT#
RegisterServerEvent('--:server:GroupEvent')
AddEventHandler('--:server:GroupEvent', function(groupID, event_type, event, args)
    exports["nelo-tablet"]:NeloGroupEvent(groupID, event_type, event, args)
end)
```

{% endtab %}
{% endtabs %}

[^1]: <mark style="color:red;">Regardless of</mark> <mark style="color:red;"></mark><mark style="color:red;">**whether it will be a synchronized client or server**</mark> <mark style="color:red;"></mark><mark style="color:red;">event, we must call our server event that synchronizes the members</mark>

[^2]: , <mark style="color:blue;">and we are passing the</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**group ID**</mark> <mark style="color:blue;"></mark><mark style="color:blue;">to it.</mark>

[^3]: <mark style="color:yellow;">We specify whether the event is client or server.</mark>

[^4]: Here, we specify which event we want to synchronize.

[^5]: <mark style="color:purple;">Does it have any additional arguments to be passed? If not, it's not necessary to include them.</mark>
