Hey everyone! I need your help about two problems. I am trying to make a money bag skript. Basically, when player right clicks with a book, I want an inventory to open with the number of gold nuggets according to the item's lore. Check the code you will get what I mean.
My first problem is how can I use the number in item's lore as variable? Or is there another way to do it?
And my second problem is how can I write 4. line? Obviously my example won't work. It is just to show you what I mean
Thanks in advance!
Code:
on right click with book named "Money Bag":
If the 1st line of the lore of the player's tool is "Total Amount: %number%":
open chest inventory with 3 rows named "Money Bag" to player
put %number% of gold nuggets into player's inventory
on inventory close:
if name of event-inventory is "Money Bag":
set {_money} to amount of gold nuggets in event-inventory
set player's tool to book named "Money Bag" with lore "Total Amount: %number%"
on inventory click:
if name of event-inventory is "Money Bag":
if event-item is not gold nugget:
cancel event
My first problem is how can I use the number in item's lore as variable? Or is there another way to do it?
And my second problem is how can I write 4. line? Obviously my example won't work. It is just to show you what I mean
Thanks in advance!