how do i fix this error in the code

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

Madoc

Member
Jun 6, 2022
14
0
1
20
Code:
command /pets:
    permission: server.owner
    trigger:
        pets(player)
        
        

        
on inventory click:
    if name of player's current inventory contains "&aPets":
        cancel event
        if clicked inventory != player's inventory:
            if index of event-slot = 49:
                close player's inventory
            if index of event-slot = 51:
                delete {current::pet::%player's uuid%}
                send "&cYou Removed your pet!"
                
        
function pets(P: player):
    open chest inventory with 6 rows named "&aPets" to {_P}
    set slot integers between 45 and 54 of {_P}'s current inventory to black stained glass pane named ""
    set slot 49 of {_P}'s current inventory to barrier named "&c&lClose"
    set slot 51 of {_P}'s current inventory to tnt named "&cRemove Pet"
    
    set {_var} to -1
    loop  {pets::%{_P}'s uuid%}:
    add 1 to {_var}
    set slot {_var} of {_P}'s current inventory to loop-value
 

Attachments

  • Screenshot_53.png
    Screenshot_53.png
    181 KB · Views: 99