startResource
Shared
Starts a resource right away, after starting the resources it includes with <include> in its meta.xml.
bool startResource(string name)
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The resource's name. |
Returns
true if the resource is running when the call ends (also when it already ran), false if it does not exist, an included resource is missing or failed, or the start was cancelled.
Before running the scripts it fires onResourcePreStart, which can cancel the start, and at the end onResourceStart.
Example
if not startResource("scoreboard") then
outputServerLog("scoreboard could not start")
endNoteIt takes the name only: a stopped resource has no element to give.