Triggers an event on the specified client(s), and passes on any additional arguments.
TriggerClientEvent(string eventName, int playerId[, ...])
- eventName: A string representing the event name to call on the client.
- playerId: The ID of the player to call the event for. Specify -1 for all clients.
- …: Any additional data that should be passed along.
Don’t forget to RegisterNetEvent!
AddEventHandler('eventName', function(text) print(('I just received %s from the server'):format(text)) -- I just received Hello world! from the server end)
TriggerClientEvent('eventName', playerId, 'Hello world!')
Last modified May 22, 2020: TriggerClientEvent example (40711c0)