ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. callExport

Function

callExport

Server and clientResourcesTrilogy Hub only

Calls another resource's export without warnings when the resource or the function is missing. It first returns whether the call succeeded.

Syntax

bool, mixed callExport(string res, string functionName [, mixed ...])

Arguments

resstring
The resource name or the resource.
functionNamestring
The export name.
...mixed, optional
Arguments for the export.

Returns

true and the export's results; false and a reason: "bad_argument", "not_running", "no_export" or the error text.

Example

local ok, money = callExport("bank", "getMoney", player)
if not ok then money = 0 end

See also