# startResource (Shared)

> Starts a resource right away, after starting the resources it includes with `<include>` in its `meta.xml`.

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

## Syntax

```lua
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

```lua
if not startResource("scoreboard") then
    outputServerLog("scoreboard could not start")
end
```

### Note

It takes the name only: a stopped resource has no element to give.

## See also

- [stopResource (Shared)](https://wiki.mymp.gg/en/stopResource.md): Asks to stop a running resource. It stops on the next resource pulse, not during the call.
- [restartResource (Shared)](https://wiki.mymp.gg/en/restartResource.md): Asks to stop and start again a running resource. It happens on the next resource pulse, not during the call, and the resource keeps its place in the start order.
- [getResourceState (Shared)](https://wiki.mymp.gg/en/getResourceState.md): Tells which state a resource is in.
- [onResourceStart (Server)](https://wiki.mymp.gg/en/onResourceStart.md): Fired when a resource has finished starting, after its scripts and maps have run.
