Multiple Use Item

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
YunO
001 Fanatic
 
Joined: Thu Dec 27, 2007 8:38 pm
Location: (un)fortunately Brazil!

Multiple Use Item

Postby YunO » Mon Nov 02, 2015 9:45 pm

As there is no event allowing to use an item multiple times, I had to create my own script.
The problem is, as the player has more than one of such item in the inventory, he could type in an amount of times the item would be consumed, subtracting from what there is in the inventory.
If I have 15 Lesser HP Potions that recover a small amount of health, I could type in and use 10 of those instead of clicking 10 times.

Thus, I made this script:


And it all works out, but it doesn't use the item. Not even once.
I know that my loop isn't the best, but it (should) work.
Huge project coming soon...

Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron