call
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function is used to call a function from another resource (which must be running).
Calls (exports) may incur a performance overhead - they are not equivalent in performance to calling functions in the same resource. Do not use exports in render events (like onClientRender ), or in fast processing logic, unless you want to kill performance. The sourceResource and sourceResourceRoot "hidden" variables are available even if you use exports.: Using this function straight away on resource start might cause elements to not be passed properly, use setTimer in order to delay function execution and to avoid this issue.
Syntax
call ( )Code Examples
This extract shows adding of a "kills" column to the scoreboard resource. This then sets thegameShowKillsvariable to true(or false), telling the rest of the script to start outputting kills.
function showKills ( option ) if not option then -- Remove the "kills" column exports.scoreboard:removeScoreboardColumn("kills") else -- Add the "kills" column exports["scoreboard"]:addScoreboardColumn("kills") outputDebugString ( "Showing kills now..." ) end gameShowKills = optionendSee Also
Resource Functions
- abortRemoteRequest
- addResourceConfig
- addResourceMap
- call
- callRemote
- copyResource
- createResource
- deleteResource
- fetchRemote
- getRemoteRequestInfo
- getRemoteRequests
- getResourceACLRequests
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceGUIElement
- getResourceInfo
- getResourceLastStartTime
- getResourceLoadFailureReason
- getResourceLoadTime
- getResourceMapRootElement
- getResourceName
- getResourceOrganizationalPath
- getResourceRootElement
- getResources
- getResourceState
- getThisResource
- isResourceArchived
- isResourceProtected
- refreshResources
- removeResourceFile
- renameResource
- restartResource
- setResourceInfo
- startResource
- stopResource
- updateResourceACLRequest