Skript - CustomEnchant Book Opening Problem

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

    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.

TheRealFangz

Member
Mar 3, 2018
1
0
0
I'v recently go into making a custom enchantment skript for my server, I have got to the part where revealing books chooses between a set ratio of numbers, but when right clicking any item it discovers an enchant, and not the book with the name that should be discovering it.

Here is the code:


code_language.skript:
on rightclick:
    if player's held item is book named "&fCommon Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&fCommon &7Enchantment Book.":
    remove 1 book named "&fCommon Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&fCommon &7Enchantment Book." from player
    launch flickering trailing burst firework colored white at player timed 1
    chance of 100%
    set {common} to a random integer between 1 and 1
    if {common} is 1:
        give player 1 book named "Will edit later"
        stop

on rightclick:
    if player's held item is book named "&bRare Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&bRare &7Enchantment Book.":
    remove 1 book named "&bRare Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&bRare &7Enchantment Book." from player
    launch flickering trailing burst firework colored white at player timed 1
    set {rare} to a random integer between 1 and 1
    if {rare} is 1:
        give player 1 book named "Will edit later 2"
        stop

on rightclick:
    if player's held item is book named "&6Legendary Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&6Legendary &7Enchantment Book.":
    remove 1 book named "&6Legendary Enchantment Book &7(Right Click)" with lore "&7Examine to recieve a random||&6Legendary &7Enchantment Book." from player
    launch flickering trailing burst firework colored white at player timed 1
    set {legendary} to a random integer between 1 and 1
    if {legendary} is 1:
        give player 1 book named "Will edit later 3"
        stop
 
code_language.skript:
on right click with book:
    if name of player's tool is "NAME OF BOOK":
        if lore of player's tool is "LORE OF PLAYER's TOOL":
            #Do Stuff

Solved
 
Status
Not open for further replies.