RPG Maker Forums

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.

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top