Help i having 2 problems here .
the First is when the Sword have a example:
If i apply the book with Extra Sharp 1 in a diamond sword which already has that mod "Extra Sharp 2"
it still applying to the sword. i dont know how to solve that .
The second trouble is if there is any way to simplify the code, because its kinda long and with many repetitive conditions
the First is when the Sword have a example:
If i apply the book with Extra Sharp 1 in a diamond sword which already has that mod "Extra Sharp 2"
it still applying to the sword. i dont know how to solve that .
The second trouble is if there is any way to simplify the code, because its kinda long and with many repetitive conditions
Code:
on inventory click:
player's cursor slot is book:
if event-slot is any sword:
if name of cursor slot of player is "&cWeapon Mod":
set {_name} to "%lore of cursor slot of player%"
if lore of event-slot contains "%{_name}%":
send "&cYou already have This mod"
stop
cancel event
#Detect if the player doesnt have any "Mod-Slot" the first 2 lines.
if line 1 of lore of event-slot is not set:
set line 1 of lore of event-slot to {_name}
send "&fEnchantment &d%{_name}% &fapplied"
remove 1 of player's cursor slot from player's cursor slot
stop
if line 2 of lore of event-slot is not set:
set line 2 of lore of event-slot to {_name}
send "&fEnchantment &d%{_name}% &fapplied"
remove 1 of player's cursor slot from player's cursor slot
stop
remove 1 of player's cursor slot from player's cursor slot
#Detect If the player had in their lore line "Mod-Slot" .
if line 2 of lore of event-slot contains "Mod-Slot":
set line 2 of lore of event-slot to {_name}
send "&fEnchantment &d%{_name}% &fapplied"
stop
if line 3 of lore of event-slot contains "Mod-Slot":
set line 3 of lore of event-slot to {_name}
send "&fEnchantment &d%{_name}% &fapplied"
stop
if line 4 of lore of event-slot contains "Mod-Slot":
set line 4 of lore of event-slot to {_name}
send "&fEnchantment &d%{_name}% &fapplied"
stop