util.resource.start

Server

Starts a loaded resource


Syntax

local result = util.resource.start(
    name
)

The resource must be loaded before it can be started.

  • Already running — returns false if the resource is already running.
  • Not loaded — returns false if the resource has not been loaded.
  • Async — the start is enqueued and executes on the next main thread tick; the resource will not be running immediately after this call returns.

Parameters

TypeNameDescription
stringnameName of the resource to start

Returns

TypeNameDescription
boolresulttrue if the start was enqueued successfully, false otherwise

Examples

Start a resource
util.resource.start("my_resource")
Guard start with a running check
if not util.resource.is_running("my_resource") then
    util.resource.start("my_resource")
end

On this page