onClientResourceStart | Multi Theft Auto: Wiki Skip to content

onClientResourceStart

Client-side
Server-side
Shared

This event is triggered when a resource is started. Please note that this is not triggered the same time as the serverside event onResourceStart is. The event is triggered when any clientside resources are started. This means it is triggered when a clientside script is initiated after a download, which includes downloading after join. So:

Parameters

resource startedResource
  • startedResource: the resource that was started.

Source

element: The source of this event is the started resource's root element.

Code Examples

client

This example outputs name of resource that was started.

addEventHandler( "onClientResourceStart", getRootElement( ),
function ( startedRes )
outputChatBox( "Resource started: " .. getResourceName( startedRes ) );
end
);