So i've been trying for a while here to try and make this code here work
It sort of works, and by that I mean with items that are different types they work fine, but when it comes to 2 of the same item type, but different name and lore, it takes whatever the last one I added and makes all of the items of that type the exact same item. How would I fix this?
Yes this is using TuSKe
It sort of works, and by that I mean with items that are different types they work fine, but when it comes to 2 of the same item type, but different name and lore, it takes whatever the last one I added and makes all of the items of that type the exact same item. How would I fix this?
Yes this is using TuSKe
Code:
command /weaponshop:
trigger:
set {_p} to player
set {_uuid} to player's uuid
if {%player's uuid%::ingame} is false:
send "{@prefix} &aOpening the weapon shop..."
open virtual chest with 6 rows named "&cWeapon Shop" to {_p}
set {_wc} to 0
loop {weapons::*}:
set {_w} to loop-value
broadcast "%{_w}%"
format gui slot {_wc} of {_p} with {weapons::%loop-value%::shopitem} to run:
if {%{_uuid}%::weapons::*} contains {_w}:
send "{@prefix} &cYou allready own that weapon!"
else if {%{_uuid}%::level} < {weapons::%{_w}%::requiredlevel}:
send "{@prefix} &cYou are not a high enough level to buy that weapon!"
else:
if {%{_uuid}%::coins} >= {weapons::%{_w}%::cost}:
send "{@prefix} &aWeapon Purchase successful!"
remove {weapons::%{_w}%::cost} from {%{_uuid}%::coins}
add {_w} to {%{_uuid}%::weapons::*}
close player's inventory
else:
send "{@prefix} &cYou do not have enough coins to purchase this."
add 1 to {_wc}
else:
send "{@prefix} &cYou may not use this command right now!"