Project Sloth Inventory

Improve compatibility between our Meth Crafting & ps-inventory

Due to the way ps-inventory handles custom metadata variables, we must explicitly tell the inventory script to display the values for parameters such as "strain", "purity", etc. Follow the simple steps below to do this!

Method 1 - Download & Replace

There is two different ways we can do this, and this method is the simplest way. If you haven't made any custom edits or changes to the app.js file found in your ps-inventory (you would likely know if you did), then this will work for you! If you have custom edits or changes made to the app.js file, continue to method two below.

Step 1

Download the app.js file below and drag, drop & replace the one found in your inventory script in the following directory: ps-inventory/html/js

Method 2 - Manually Add Code

Step 1

Navigate to ps-inventory/html/js/app.js & open this file in Visual Studio Code or a similar editor. Search for the item "markedbills" (at the time of this writing it is found on line 640). Then, place your cursor at the end of this code block, just like the image example below:

Step 2

Hit enter to create a new, empty line. And paste in the following code:

// Start of lation_meth items
} else if (itemData.name == "ls_liquid_meth" || itemData.name == "ls_meth" || itemData.name == "ls_meth_tray" || itemData.name == "ls_meth_box") {
    $(".item-info-title").html("<p>" + itemData.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Strain: </strong><span>" +
        itemData.info.strain +
        "</span></p><p><strong>Purity: </strong><span>" +
        itemData.info.purity +
        "%</span></p>"
    );
} else if (itemData.name == "ls_ammonia" || itemData.name == "ls_iodine" || itemData.name == "ls_acetone") {
    $(".item-info-title").html("<p>" + itemData.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Remaining: </strong><span>" +
        itemData.info.quality +
        "%</span></p>"
    );
// End of lation_meth items

You're code should now look similar to the example in the image below:

Save, restart your server & you'll now see the necessary information when you hover over these items in your inventory!

Are you stuck?

No worries! If you need any help or experience any issues after following these instructions feel free to reach out to us via Discord or email at support@lationscripts.com.

Last updated