# refreshResources (Shared)

> Reads the resources folder again: adds the new resources, removes the ones that are gone (stopping those that ran) and logs which running resources changed on disk.

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

## Syntax

```lua
int refreshResources()
```

## Returns

How many resources are known after the scan. On the client, which has no resources folder, `0`.

A resource that changed on disk keeps running the old version until it is restarted.

## Example

```lua
addCommandHandler("refresh", function()
    local count = refreshResources()
    outputServerLog(count .. " resources known")
end)
```

## See also

- [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.
- [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.
- [deleteResource (Server)](https://wiki.mymp.gg/en/deleteResource.md): Takes a stopped resource out of the resource list and moves its folder or archive into the trash folder of the server's resource cache.
