Solved Enchant skript error

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

rook1e

New Member
Apr 9, 2020
6
0
0
28
I create enchant system with GUI inventory.
But under code don't work...

Code:
variables:
  {enchant_type::sh} = "sharpness"
  {enchant_type::ef} = "efficiency"

on inventory click:
  if inventory name of player's current inventory contains "&r&b%player%&r's Upgrade Table":
    if clicked slot's type is nether star:
      set {_target} to slot 10 of player's current inventory
      set {_stonez} to slot 13 of player's current inventory
      # slot 13 is stone have lore format ex) "sh 5" / "ef 7"

      set {_split::*} to uncoloured line 1 of {_stonez}'s lore split at " "

      set {_enchant_type} to {_split::1}


      set {_chkenc} to {enchant_type::%{_enchant_type}%} parsed as enchantment
      set {_level} to level of {_chkenc} of {_target}

      message "lv : %{_level}%" to player

result is always <none>
how can I fix this problem?
 
I tried your example and indeed, it always returns none. What I did to fix it was change this line:
code_language.skript:
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
 
I tried your example and indeed, it always returns none. What I did to fix it was change this line:
code_language.skript:
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

I solved this problem!
Thanks for your help :emoji_slight_smile:
 
Status
Not open for further replies.