Discord Thread Drag & Drop Inventory Event

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

Nutrition35

Member
Feb 11, 2020
11
0
1
19
I have this skript I just made here,
code_language.skript:
vb
on inventory click:
  if event-inventoryaction is swap with cursor:
    if cursor slot of player is nether star named "&6&lDash I":
      if event-slot is sword:
        cancel event
        set {Sword} to event-slot 
        set cursor slot of player to air
        play sound "block.note_block.pling" at volume 1 at pitch 2 to player
        set the 2nd line of {Sword}'s lore to "&6Dash I"
        if the 2nd line of {Sword}'s lore is not set:
          set the 2nd line of {Sword}'s lore to "&6Dash I"
          broadcast "done!"
        else:
          set lore of {Sword} to "&6Dash I"
          broadcast "done!"
However, when I run the skript, it works perfectly fine and the first broadcast is completed, but the lore of the item in my inventory is not being set at all, how do y'all think I can fix this? Thanks.

Posted by: nutrition35 from the skUnity Discord. View the thread on skUnity Discord here
 
also added a 1 tick wait in between actions to see if that would change anything, it doesnt.
code_language.skript:
vb
on inventory click:
  if event-inventoryaction is swap with cursor:
    if cursor slot of player is nether star named "&6&lDash I":
      if event-item is sword:
        if the 2nd line of event-item's lore is not set:
          cancel event
          wait 2 ticks
          set {_sword} to event-item
          broadcast {_sword}
          set the 2nd line of {_sword}'s lore to "&6Dash I"
          broadcast "done!"
          set cursor slot of player to air
          play sound "block.note_block.pling" at volume 1 at pitch 2 to player

This gets me this outcome:


Posted by: nutrition35 from the skUnity Discord.
 
Status
Not open for further replies.