Hello,
I’m stuck on javascript programming for my rpg game.
I want my characters to have an access to a place if they have enough money to pay 5 credits and have with them the item « entrance ticket ».
I tried to create a script to have everything working :
if ($gameParty._gold < 5 ){
$gameMessage.add("You don’t have enough money");
} else {
$gameMessage.add("you have enough money");
$gameParty._gold = $gameParty._gold - 5;
$gameParty.gainItem($dataItems[5], 1);
}
But I don’t know how to check if the item is truly in stock because it doesn’t show in the inventory of my characters. However I can open the entrance gate which means (I guess )that the item is reknown (I changed the number of dataItems to test and the gate doesn’t open)
And I also tried with Rpg maker system, this time the ticket is properly shown in the inventory of my characters. Everything is working, except that I would like the seller to stop selling ticket when my character have already bought one and show them a message like : « You already have a ticket ».
To recap I would like to do that :
-check if the character have enough money (5 credits)
-inform them if they don’t have enough credits
-inform them that they can’t buy other ticket if the already have bought one.
Thank you 🙂
Have a good day
Bap
I’m stuck on javascript programming for my rpg game.
I want my characters to have an access to a place if they have enough money to pay 5 credits and have with them the item « entrance ticket ».
I tried to create a script to have everything working :
if ($gameParty._gold < 5 ){
$gameMessage.add("You don’t have enough money");
} else {
$gameMessage.add("you have enough money");
$gameParty._gold = $gameParty._gold - 5;
$gameParty.gainItem($dataItems[5], 1);
}
But I don’t know how to check if the item is truly in stock because it doesn’t show in the inventory of my characters. However I can open the entrance gate which means (I guess )that the item is reknown (I changed the number of dataItems to test and the gate doesn’t open)
And I also tried with Rpg maker system, this time the ticket is properly shown in the inventory of my characters. Everything is working, except that I would like the seller to stop selling ticket when my character have already bought one and show them a message like : « You already have a ticket ».
To recap I would like to do that :
-check if the character have enough money (5 credits)
-inform them if they don’t have enough credits
-inform them that they can’t buy other ticket if the already have bought one.
Thank you 🙂
Have a good day
Bap
