Im not sure what I did, but I think I broke it. Also did u find a way to make it so u cant repair items that are full durability?
Broken skript:
command /repair [<player>]:
permission: repair.use
trigger:
if arg-1 is set:
open inventory of arg-1 to arg-1
set {activeGui::%arg-1's uuid%} to "inventoryGui"
play sound "block.note_block.pling" to arg-1
send "&aPlease click an item to repair it for 50 Coins!" to arg-1
else:
open inventory of player to player
set {activeGui::%player's uuid%} to "inventoryGui"
play sound "block.note_block.pling" to player
send "&aPlease click an item to repair it for 50 Coins!" to player
on inventory click:
{activeGui::%player's uuid%} = "inventoryGui"
cancel event
set {_dura} to max durability of clicked item
set {_fix} to durability of clicked item
if {_fix} < {_dura}:
if {@balance} >= {@repair_cost}:
remove {@repair_cost} from {@balance}
repair clicked item
play sound "block.note_block.pling" to player
else:
play sound "entity.villager.no" to player
send "&cYou do not have enough!"
else if {_fix} >= {_dura}:
play sound "entity.villager.no" to player
on inventory close:
if {activeGui::%player's uuid%} is "inventoryGui":
delete {activeGui::%player's uuid%}
send "&cYou have canceled your purchase!"
Also I made it so the player in the command (Argument-1) doesnt get opened to the executer, but to arg-1. That was my original intention, but it seemed to break it