From the reference libraryFiveM

emit-client

fivem-docs/docs/scripting-reference/runtimes/javascript/functions/emit-client.md

emit-client


title: Emit - client

Use emit function when you want to trigger an event on the same client.
You need to declare the event on the client with on or onNet first.

Signature

function emit(eventName: string, ...args?: any ) => void

Signature > Required argument

  • eventName: The event name you want to trigger.

Signature > Optional arguments

  • ...args: The arguments you want to pass.

Examples

// No arg
emit("foo:gimmeAFrenchBread");

// With args
emit("foo:gimmeSomeFrenchBread", amount);

title: Emit - client

Use emit function when you want to trigger an event on the same client.
You need to declare the event on the client with on or onNet first.

Back to documentation