help with enchanted books

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

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

harel

Member
Jan 19, 2022
4
1
3
20
hey guys i am trying to do a npc that sells a enchanted books and this is my code:
on inventory click:
event-inventory = (metadata tag "dorinv" of player):
cancel event
index of event-slot = 11:
if {money::%player's UUID%} is more than or equal to 10000:
remove 10000 from {money::%player's UUID%}
give player 1 enchanted book{StoredEnchantments:[{id:"minecraft:unbreaking",lvl:4}]}
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
index of event-slot = 13:
if {money::%player's UUID%} is more than or equal to 12000:
remove 12000 from {money::%player's UUID%}
give player 1 enchanted book of protection 6 named "&dProtection VI" with lore "&dSpecial"
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
index of event-slot = 15:
if {money::%player's UUID%} is more than or equal to 14000:
remove 14000 from {money::%player's UUID%}
give player 1 enchanted book of efficiency 6 named "&dEfficiency VI" with lore "&dSpecial"
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
so when its give the enchatment book its doesnt work on anvil, someone can help?

[doublepost=1642614111,1642614050][/doublepost]ingore all the other staff in this code all i need is this:
give player 1 enchanted book of efficiency 6 named "&dEfficiency VI" with lore "&dSpecial"
its doesnt work on anvil how to fix it?
 
Status
Not open for further replies.