Use on
function when you want to listen from server only.
This declares an event which gets triggered with emit from the server.
function on(eventName: string, fn: Function) => void
on(
"foo:kickBar",
// We can add callback
(barId: string, cb: Function => {
DropPlayer(barId, "Foo doesn't want you anymore!");
cb("Job is done!");
}
);