This event is triggered when the resource is stopped. This can occur for a number of reasons:
- The stop console command was used
- The restart console command was used
- The resource was modified (the resource will automatically restart)
- Another resource stopped it using stopResource.
Note: If you wish to just detect a single resource being stopped, you should attach handlers for this event to the resource's root element. You can access this using getResourceRootElement.
resource stoppedResource, boolean wasDeleted
- stoppedResource: the resource that is being stopped.
- wasDeleted: a boolean representing whether the resource folder was deleted, moved or renamed.
This example displays a message in the chatbox when a resource is stopped.
addEventHandler( "onResourceStop", root, function( resource ) outputChatBox( "The resource " .. getResourceName( resource ) .. " was stopped!", root ) end )
This example only outputs message if the stopped resource is the same resource where the eventHandler is.
addEventHandler( "onResourceStop", resourceRoot, function( resource ) outputChatBox( "This resource has stopped!", root ) end )
|1.5.5-3.11854||Added wasDeleted parameter|