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.
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}!"