M MY Multiplayer: Wiki
Side
Kind

deleteResource

Server

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.

bool deleteResource(resource|string resource)

Parameters

NameTypeDescription
resourceresource|stringThe resource, or its name.

Returns

true if the resource was moved, false otherwise.

Example

addCommandHandler("delres", function(player, command, name)
    if getResourceState(name) == "loaded" then
        deleteResource(name)
    end
end)
NoteA resource that is not stopped cannot be deleted. Since stopResource only stops the resource on the next pulse, calling deleteResource right after it fails.

See also