Hi,
this is my code:
Everything works fine, but when I put my sword into the "Mystic Well" and I want to enchant that, it just close my inventory and nothing else happens. It doesn't add any lore to my item.
This is a snippet from my Mystic Well GUI
{_p} stands for player and {_i} is the event-item
Does anyone know why the Mystic Well doesn't do anything?
this is my code:
Code:
on inventory click:
if name of player's current inventory is "&d&lMystic Well":
if event-item is "&cMystic Sword":
openWellTierI(player, event-item)
This is a snippet from my Mystic Well GUI
Code:
make gui slot "k" with enchanted book named "&aEnchant to Tier I" with lore "" and "&7Price: &61000g" and "":
enchantTierI({_p}, {_i})
Code:
function enchantTierI(p: player, i: item):
set {_ench} to a random element out of {swordench::*}
set {_tier} to a random integer between 1 and 3
if {_tier} = 1:
set {_roman} to "I"
if {_tier} = 2:
set {_roman} to "II"
if {_tier} = 3:
set {_roman} to "III"
set {final} to "%{_ench}% %{_roman}%"
delete {_i}'s lore
set the name of {_i} to "&cTier I Sword"
add "&o" to {_i}'s lore
addLoreSword({_p}, {_i}, {final})
msgEnch({_p}, "Tier I Sword", {_ench})