#Magic Lol

1 messages · Page 1 of 1 (latest)

dull harbor
#
    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

prisma patrol
#

remove %%

dull harbor
#

alr

prisma patrol
#

%loop-index% -1

dull harbor
#

I'm guessing for loop-index

#

yeah

#

F did nothing

prisma patrol
#

it did something

dull harbor
#

?

prisma patrol
#

try removing loop-index -1 and just putting 1 instead

dull harbor
#

yeah

#

that works

prisma patrol
#

something to do with loop-index

dull harbor
#

mhm

prisma patrol
#

try debugging loop-index

dull harbor
#

so wait lemme try

prisma patrol
#

thats not what i mean by debug

dull harbor
#

got it

#

no Ik but an idea

#

parse from a string to an int

#

works

prisma patrol
#

alr

dull harbor
#
    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 parsed as a number) - 1) of metadata tag "guimagic" of {_p} to lime dye named "&5%loop-value%" with lore "&aSelected"
        else:
            set slot ((loop-index parsed as a number) - 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]"
remote plover
#

looks sick

dull harbor
#

thanks lol

remote plover
#

i was just thinking maybe going gui-less would be better

#

like how wynncraft uses L+R button presses to do spells

dull harbor
#

I was thinking of that

remote plover
#

or it could be a scroll system where you can right click to swap through

#

guis get a bit annoying to navigate during combat

dull harbor
#

I might do that as like a quicker way

#

I just like seeing all known spells

remote plover
#

you can have the gui as a shift click thing

dull harbor
#

true

remote plover
#

or use another key

dull harbor
#

Magic Lol

remote plover
#

like Swap Item to Offhand

remote plover
#

its great

dull harbor
#

Well I have like a list of spells and like I'd say 20% is more like commerce like teleport waypoint thing, and one that just detects nearby mobs in like 30b radius

remote plover
#

ahh, ic

#

so theyre not all combat focused

dull harbor
#

yeah

#

they'll have casting time

remote plover
#

maybe the right click scroll could just be combat spells, then the gui lists all of them

#

or smth like that

dull harbor
#

I was making like you can either waste the tome to cast the spell without mana or wait time, or you can use it to learn it but have a cast time and mana

dull harbor
remote plover
#

ive got no clue then lol

dull harbor
#

Xd

#

I'm planning on making like a Server sorta like factions but mythical medieval, seven total kingdoms each with like ten towns/(not ten cities lol) cities, and yeah

remote plover
#

ooh

#

sounds fun

dull harbor
#

yeah

#

going to take awhile lol

prisma patrol
#

?

#

oops

dull harbor
#

lol

prisma patrol
#

didn't even realise there were other messages

dull harbor
#
    if inventory name of player's current inventory contains "&cMagic Spell List":
        cancel event
        set {_s} to uncolored name of event-item
        #Spell Replacement
        if {spellDelete::%player's uuid%} is true:
            loop {magicList::%player's uuid%::*}:
                if {_s} contains "%loop-value%":
                    loop lore of player's held item:
                        if loop-value-2 contains "Spell:":
                            set {_lt::*} to loop-value-2 split at ":"
                            #Issue here, it won't set to section in variable
                            set {magicList::%player's uuid%::(loop-index parsed as a number)} to {_lt::2}
                            send "&cYou learned &5[&b%{_lt::2}%&5]"
                            close player's inventory
                            stop #Ik uncessary
        #Spell Selection
        else:
            set {_lore::*} to uncolored lore of player's held item
            if {_lore::2} != {_s}:
                set player's held item's lore to "&7Magic for dummies" and "&7%{_s}%"
                close player's inventory```
#

It'll add onto the list rather than replacing the section of the list

#

like I have a check for a command to send me my know spells in text, and I get "MM, MS, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17"

#

Limit I set for the list is 18, but goes beyond that

#

full code^

#

well semi, Not done with it

dull harbor
#

Wait

#

I might know something that could work