set metadata tag "guimagic" of {_p} to chest inventory with 2 row named "&cMagic Spell List"
loop {magicList::%{_p}%::*}:
if {_l} contains "%loop-value%":
set slot (%loop-index% - 1) of metadata tag "guimagic" of {_p} to lime dye named "&5%loop-value%" with lore "&aSelected"
else:
set slot (%loop-index% - 1) of metadata tag "guimagic" of {_p} to gray dye named "&5%loop-value%"
open (metadata tag "guimagic" of {_p}) to {_p}
Variables:
{magicList::*::1} = "Magic Missile"
{magicList::*::2} = "Magic Staff"
command /testwand:
permission: Magic.Staff
permission message: "&4&lYou tried but failed :p"
trigger:
give a stick named "&bMagical Wand" with lore "&7Magic for dummies" and "&7None" to player
command /resetmagic:
permission: Magic.Staff
permission message: "&4&lYou tried but failed :p"
trigger:
set {magicList::%player's uuid%::*} to "Magic Missile", and "Magic Staff"
on right click:
if player is holding a stick named "&bMagical Wand":
set {_lore::*} to uncolored lore of item
magicGui(player, {_lore::2})
if player is holding a book named "&5Magical Tome":
if targeted block is enchanting table:
cancel event
loop lore of player's held item:
if loop-value contains "Spell:":
set {_lt::*} to loop-value split at ":"
if {magicList::%player's uuid%::*} contains {_lt::2}:
send "&cSorry but you already have &5[&b%{_lt::2}%&5]"
else:
add {_lt::2} to {magicList::%player's uuid%::*}
send "&cYou learned &5[&b%{_lt::2}%&5]"
Basically I want this to show a list of all the 'spells' a player would know in a gui, after learning a spell but I get this error down here after taking apart the skript 7 times now V