- Documentation
- Server functions
- getResourceLoadFailureReason
Function
getResourceLoadFailureReason
Returns why a resource failed to start. An empty string = no error. In the current server version it always returns an empty string; load errors show up in the server console.
Syntax
string getResourceLoadFailureReason(resource theResource)Arguments
theResourceresource- The resource.
Returns
The reason or "".
Example
local res = getResourceFromName("race")
if not startResource(res) then
outputServerLog("race: " .. getResourceLoadFailureReason(res))
end
See also
startResourceStarts a stopped resource. It loads its scripts, maps and files, and players download it.getResourceStateReturns the resource state:"running"when it runs or"loaded"when it is on disk but stopped. It also works on the client: there it only knows the resources running for the player, so it returns"running"orfalse.