ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
ESXclient

ESX.TriggerServerCallback

ESX client documentation with a FiveM Lua example.

Summary

Client-side call that invokes a registered ESX server callback and awaits its response. Pairs with ESX.RegisterServerCallback.

Returns

void (result via callback).

Parameters

namestringThe callback name.
cbfunctionReceives the server's response.
...anyArguments to send.

Example

ESX.TriggerServerCallback('myscript:getMoney', function(money)
  print(money)
end)

Common pitfalls

  • The server must have registered the callback with the same name.
  • The server handler must call cb(...) or this never resolves.

Related functions

Related guides

FiveM scripts done right

Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.

Browse Scripts →