Check a gui slot for a item and lore

  • 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 community!

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Toggle

Member
Mar 25, 2021
1
0
1
I'm trying to check a gui slot that a player can put items in that sets that gui slot to a variable and gives it a lore if it doesn't have one already. If anyone knows how to do this and could help me that would be amazing.


Code:
on right click on end portal frame:
   if player's world is not "spawn":
       send "&cNo"
       stop
   else:
       set {_slot} to 0
       create a gui with virtual chest with 4 rows named "&8&lItem Converter":
           loop 36 times:
               make gui slot {_slot} with gray stained glass pane named "&7"
               add 1 to {_slot}
           remove gui slot 11
           set {_playerItem} to gui slot 11 of player
           make gui slot 20 with gray dye named "&dConvert Item":
               if {_playerItem} contains a diamond sword:
                   if lore of {_playerItem} tool doesn't contain "&cConverted Item":
                       close player's inventory
                       send "&eCongrats!"
                       give player {_playerItem}
                   else:
                       stop
               else:
                   close player's inventory
                   give player {_playerItem}
                   send "&cYou can only convert weapons and armor to a converted item."
                   stop
       open last gui to player
 
Status
Not open for further replies.