From the reference libraryFiveM

emitNet-client

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

emitNet-client


title: EmitNet - client

Use emitNet function when you want to trigger an event from the client to the server.
You need to declare the event on the server with onNet first.

Signature

function emitNet(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
emitNet("foo:killPatrickForMe");

// With args
emitNet("foo:killThisGuyForMe", 2);
Back to documentation