Engine.StartResource

From Tomb Raider Mod Launcher Wiki
Jump to navigation Jump to search

Function

function bool Engine.StartResource(resourceName);

Arguments

  • resourceName
    • The name of the resource to start.

Description

This function will attempt to start the resource.

Returns

The function returns if the server was able to start the resource, possible reasons could include scripts containing errors.

Example

// Add a handler for "start" to that we can start a resource using the chatbox.
// It would be a good idea to check if the user is allowed to do so when possible.
// It would also be a good idea to check the number of arguments in the array to prevent errors.
//
Engine.AddCommandHandler("start",function(player, commandLine, command, arguments){
	Engine.StartResource(arguments[0]);
});

Notes

If the resource doesn't exist then an error is thrown.