detect/capture if items bought or sold in shop

● ARCHIVED · READ-ONLY
Started by tasyo 2 posts View original ↗
  1. Hi Everyone,

    May i ask some help, I'm building a custom javascript functions to call when something bought or sold in a shop, my goal is to trigger a javascript function and pass the item variables when the player bought or sold something in shop.

    Code:
    //list items in a varialble ["ItemType","ID","CustomPrice","CustomPriceValue"]
    var goods = [
       [ 0, 12, 1, 400 ],//potion
       [ 2, 30, 1, 800 ]//superpotion
    ]
    //then i use scenemanager to list the goods inside the shop
    SceneManager.push(Scene_Shop);
    SceneManager.prepareNextScene(goods, false);

    whenever the player bought or sold it will trigger the functions i created to capture what item is it (pass variables) and do some procedures.

    //this function will trigger when they buy something in shop
    Code:
    boughtItem("ItemType","ID","CustomPrice","CustomPriceValue")

    //this function will trigger when they sell something in shop
    Code:
    soldItem("ItemType","ID","CustomPrice","CustomPriceValue")

    Can somebody here can help me please how to trigger function or call a script when something is bought or sold in shop. I'm still new in RRMV and need to learn more thanks.
  2. You have already posted this query and did not even wait an hour for a reply before posting a new thread.

    One query, one thread.
    [mod]I am therefore closing this one.[/mod]