[HELP] Function as an arg of an EventHandler

Hi everyone ! :slightly_smiling_face:

Last week, I saw the following code in the [esx_status/server/main.lua] :
screen6
I had a hard time wrapping my head around it, but when I understand the idea of the arg [cb] being a function passed by the TriggerEvent, I found the idea really cool !

So when I started to work on one of my script, I decided to implement the same kind of EventHandler, but I can’t make it work.
After a masive number of tries, I always end-up with this error :
screen7

What I’m trying to do is the following :
I have a global variable [CopsConnected] on my server script wich is updated by the function [CountCops()], I need to get the value of [CopsConnected] on the client side so I decided to try the following (based on the previous code) :

server.lua

client.lua

When I declare my function in the server script, my [getter] arg is expected to be a function, function wich is the second argument when I Trigger the event on my client script.
When I [print(getter)] on the server side I get a Table, so [getter] is something but when i’m using it as a function the script goes nuts and display the error that I showed in my screen.

In my head the code sounds good, but apparently their is an issue, but impossible to put my finger on it :sob:

Peace