> For the complete documentation index, see [llms.txt](https://titans-productions.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titans-productions.gitbook.io/documentation/redm/tp-libs/functional-storages.md).

# Functional Storages

The code below is required for the framework you are using in case you are interested using Framework storages than **TP Containers**. Unfortunately, VORP and RSG are missing some very important exports and you have to add them manually.

### VORP

**INVENTORY V1 (OLD)**

Add the following code on `vorp_inventory/server/services/inventoryApiService.lua` after all the default script's code.

```lua
function InventoryAPI.getCustomInventoryIdByName(name)

    for _, data in pairs (CustomInventoryInfos) do
        if data.name == name then
            return data.id
        end
    end

    return 0

end

exports("getCustomInventoryIdByName", InventoryAPI.getCustomInventoryIdByName)

function InventoryAPI.setCustomInventoryLimit(id, limit)
    if CustomInventoryInfos[id] == nil then return end

    CustomInventoryInfos[id].limit = limit

end

exports("setCustomInventoryLimit", InventoryAPI.setCustomInventoryLimit)

```

**INVENTORY V2 (NEW)**

Add the following code on `vorp_inventory/server/services/inventoryApiService.lua` after all the default script's code.

```lua
function InventoryAPI.getCustomInventoryIdByName(name)

    for _, data in pairs (CUSTOM_INVENTORIES) do
        if data.name == name then
            return data.id
        end
    end

    return 0

end

exports("getCustomInventoryIdByName", InventoryAPI.getCustomInventoryIdByName)

function InventoryAPI.setCustomInventoryLimit(id, limit)
    if CUSTOM_INVENTORIES[id] == nil then return end

    CUSTOM_INVENTORIES[id].limit = limit

end

exports("setCustomInventoryLimit", InventoryAPI.setCustomInventoryLimit)

```

### RSG

Add the following code on `rsg-inventory/server/exports.lua` after all the default script's code.

```lua
-- The specified export is used for upgrading the max weight of an inventory stash. 
Inventory.SetInventoryWeight = function(identifier, maxweight)
    if not identifier then return end
    local inventory = Inventories[identifier]
    if not inventory then return end

    Inventories[identifier].maxweight = maxweight
end

exports("SetInventoryWeight", Inventory.SetInventoryWeight)
```
