Enchantment GUI

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

JarBinks

Member
Jun 28, 2023
17
0
1
24
Hi, I'm having a problem with my Skript.
this is my full code, but im having troubles with the /givebook command. everytime I get a book, it comes up with the title "{_randomEnchantment}" not the custom enchantment name.
Code:
options:
  script: global
  name: CustomEnchantments

command /enchantmenu:
  trigger:
    open chest with 1 row named "&aEnchantment Menu" to player
    format slot 0 of player with a written book named "&aGet Enchantment Book" with lore "&7Click to get the enchantment book." to be unstealable

on left click on written book:
  set {_clickedLore} to join lore of event-item
  set {_loreLine} to "&7Click to get the enchantment book."
  
  if {_loreLine} is in {_clickedLore}:
    set {player.enchantingbook.give.%player's uuid%} to true
    execute console command "/givebook"
    wait 1 tick
    set {player.enchantingbook.give.%player's uuid%} to false

command /givebook:
    description: Gives the player a book with a random enchantment.
    usage: /givebook

    permission: player.randomenchantment.give  # Set the appropriate permission node

    trigger:
        set {_weaponEnchantment1} to "Fireball"
        set {_weaponEnchantment2} to "Teleport"
        set {_weaponEnchantments} to {_weaponEnchantment1, _weaponEnchantment2}
        set {_randomEnchantment} to random element of {_weaponEnchantments}
        set {_bookName} to "&6{_randomEnchantment}"
        give player a book named {_bookName}
        send "You received a random weapon enchantment book: {_bookName}!"
 
its coming up with this now:
Screenshot 2023-12-21 141631.png