# onResourceStart (Server)

> Fired when a resource has finished starting, after its scripts and maps have run.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Event
- **Side**: Server
- **Category**: Resources and modules
- **URL**: https://wiki.mymp.gg/en/onResourceStart

## Syntax

```lua
addEventHandler("onResourceStart", root, function(resource startedResource) ... end)
```

## Handler parameters

| Name | Type | Description |
| --- | --- | --- |
| `startedResource` | `resource` | The resource that started. |

## Source

The element of the resource that started.

With a handler on `resourceRoot`, only the resource itself; with one on `root`, every resource.

## Example

```lua
addEventHandler("onResourceStart", root, function(startedResource)
    outputServerLog("started " .. getResourceName(startedResource))
end)
```

## See also

- [onResourceStop (Server)](https://wiki.mymp.gg/en/onResourceStop.md): Fired when a resource is about to stop, while its scripts and elements still exist.
- [onResourcePreStart (Server)](https://wiki.mymp.gg/en/onResourcePreStart.md): Fired when a resource is starting, before its scripts run. Cancelling the event keeps the resource from starting.
- [startResource (Shared)](https://wiki.mymp.gg/en/startResource.md): Starts a resource right away, after starting the resources it includes with <include> in its meta.xml.
- [getResourceName (Shared)](https://wiki.mymp.gg/en/getResourceName.md): Returns a resource's name.
