1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how do i fix this error in the code

Discussion in 'Requests' started by Madoc, Jun 11, 2022.

  1. Madoc

    Madoc Member

    Joined:
    Jun 6, 2022
    Messages:
    14
    Likes Received:
    0
    Code (Text):
    1. command /pets:
    2.     permission: server.owner
    3.     trigger:
    4.         pets(player)
    5.        
    6.        
    7.  
    8.        
    9. on inventory click:
    10.     if name of player's current inventory contains "&aPets":
    11.         cancel event
    12.         if clicked inventory != player's inventory:
    13.             if index of event-slot = 49:
    14.                 close player's inventory
    15.             if index of event-slot = 51:
    16.                 delete {current::pet::%player's uuid%}
    17.                 send "&cYou Removed your pet!"
    18.                
    19.        
    20. function pets(P: player):
    21.     open chest inventory with 6 rows named "&aPets" to {_P}
    22.     set slot integers between 45 and 54 of {_P}'s current inventory to black stained glass pane named ""
    23.     set slot 49 of {_P}'s current inventory to barrier named "&c&lClose"
    24.     set slot 51 of {_P}'s current inventory to tnt named "&cRemove Pet"
    25.    
    26.     set {_var} to -1
    27.     loop  {pets::%{_P}'s uuid%}:
    28.     add 1 to {_var}
    29.     set slot {_var} of {_P}'s current inventory to loop-value
     

    Attached Files:

  2. Shroob

    Shroob Member

    Joined:
    Jan 23, 2022
    Messages:
    4
    Likes Received:
    0
    You forgot tabs
     

    Attached Files:

Share This Page

Loading...