- Documentation
- Server functions
- getResourceFromName
Function
getResourceFromName
Returns the handle of the resource with the given name (the folder name in resources/), also when the resource is not running. Pass the handle to startResource, getResourceState, call and other resource functions.
Syntax
resource getResourceFromName(string resourceName)Arguments
resourceNamestring- Resource name.
Returns
The resource handle or false if there is none.
Example
local race = getResourceFromName("race")
if race and getResourceState(race) ~= "running" then
startResource(race)
end