1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Enchant skript error

Discussion in 'Skript' started by rook1e, Apr 9, 2020.

Thread Status:
Not open for further replies.
  1. rook1e

    rook1e New Member

    Joined:
    Apr 9, 2020
    Messages:
    6
    Likes Received:
    0
    I create enchant system with GUI inventory.
    But under code don't work...

    Code (Text):
    1. variables:
    2.   {enchant_type::sh} = "sharpness"
    3.   {enchant_type::ef} = "efficiency"
    4.  
    5. on inventory click:
    6.   if inventory name of player's current inventory contains "&r&b%player%&r's Upgrade Table":
    7.     if clicked slot's type is nether star:
    8.       set {_target} to slot 10 of player's current inventory
    9.       set {_stonez} to slot 13 of player's current inventory
    10.       # slot 13 is stone have lore format ex) "sh 5" / "ef 7"
    11.  
    12.       set {_split::*} to uncoloured line 1 of {_stonez}'s lore split at " "
    13.  
    14.       set {_enchant_type} to {_split::1}
    15.  
    16.  
    17.       set {_chkenc} to {enchant_type::%{_enchant_type}%} parsed as enchantment
    18.       set {_level} to level of {_chkenc} of {_target}
    19.  
    20.       message "lv : %{_level}%" to player
    result is always <none>
    how can I fix this problem?
     
  2. Best Answer:
    Post #2 by AsuDev, Apr 9, 2020
  3. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    244
    Likes Received:
    22
    I tried your example and indeed, it always returns none. What I did to fix it was change this line:
    Code (Skript):
    1. set {_level} to enchantment level of {_chkenc} of {_target}
    I am not sure if this requires an addon or is vanilla Skript but I am pretty sure it is vanilla. I added `enchantment` to the line of code. Here is the syntax I used: https://skripthub.net/docs/?id=929
     
  4. rook1e

    rook1e New Member

    Joined:
    Apr 9, 2020
    Messages:
    6
    Likes Received:
    0
    I solved this problem!
    Thanks for your help :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...