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 Custom Enchantment Skript won't load

Discussion in 'Skript' started by Brodzy, Sep 4, 2021.

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

    Brodzy New Member

    Joined:
    Sep 4, 2021
    Messages:
    8
    Likes Received:
    0
    I've recently started running a server on my home PC as a trial before possibly transferring all the files onto a hosted server. I am in the middle of creating a custom enchantment skript, my first skript in forever, and it doesn't seem to load. I have tried reloading the plugin itself (using PlugMan), as well as the entire server. Running the /enchanter command results in the unknown command message.

    I am using the much older version of Skript and therefore this is likely the reason, however I used this when I first started and also couldn't seem to find a download for the 2.6 version.

    Any advice would be appreciated.

    Thanks,

    Brodzy <3

    p.s. the file is a .sk file in the plugin folder

     
  2. Best Answer:
    Post #10 by Brodzy, Sep 7, 2021
  3. Crocie

    Crocie Member

    Joined:
    Jul 2, 2021
    Messages:
    27
    Likes Received:
    0
    I don't see anything wrong with the txt, try to update skript
     
  4. Brodzy

    Brodzy New Member

    Joined:
    Sep 4, 2021
    Messages:
    8
    Likes Received:
    0
    Hi Crocie. I have updated to the newest version and the /enchanter command can now be run, however many errors occur based on the spacing, yet whenever I change the spacing to the expected values, the expected value increases.
    --- Double Post Merged, Sep 4, 2021, Original Post Date: Sep 4, 2021 ---
    I seem to have gotten it working for the most part. Only issue is at the moment that you are able to click anywhere and essentially trade a diamond block for a random enchantment
     

    Attached Files:

  5. Crocie

    Crocie Member

    Joined:
    Jul 2, 2021
    Messages:
    27
    Likes Received:
    0
    I don't understand the problem
     
    #4 Crocie, Sep 4, 2021
    Last edited: Sep 4, 2021
  6. Brodzy

    Brodzy New Member

    Joined:
    Sep 4, 2021
    Messages:
    8
    Likes Received:
    0
    The GUI opens properly and does its job of essentially trading a single diamond block for an enchanted book. However, the trade occurs no matter where in the GUI you click, I am aiming for it to only function if the nether star is clicked.
     
  7. TheCubPlays

    TheCubPlays Member

    Joined:
    Jun 22, 2021
    Messages:
    35
    Likes Received:
    3
    I'm not really sure but I think that you're using skript tuske, if so you should change to skript-gui and do this:

    Code (Text):
    1. command /enchanter:
    2.         permission: enchanter.use
    3.         permission message: &cSomething broke...
    4.         trigger:
    5.                 create gui with id "enchanter" with virtual chest inventory with 1 row named "&e&k&lAA&r &7&lENCHANTER &e&k&lAA&r":
    6.                     make gui 2 with nether star with name "&eRandom Custom Enchantment" with lore "&7Costs &eDiamond Block&7!":
    7.                         if player has a diamond block:
    8.                             set {custom.enchant} to random integer between 1 and 5
    9.                             if {custom.enchant} is 1:
    10.                                 remove diamond block from player
    11.                                 set {_book} to enchanted book named "&7Blindness"
    12.                                 set line 1 of lore of {_book} to "&7Chance to apply &eblindess effect &7on the enemy!"
    13.                                 set line 2 of lore of {_book} to "&eSword Enchantment"
    14.                                 give player {_book}
    15.                             if {custom.enchant} is 2:
    16.                                 remove diamond block from player
    17.                                 set {_book} to enchanted book named "&7Speed"
    18.                                 set line 1 of lore of {_book} to "&7Applies &espeed effect &7to the user!"
    19.                                 set line 2 of lore of {_book} to "&eBoots Enchantment"
    20.                                 give player {_book}
    21.                             if {custom.enchant} is 3:
    22.                                 remove diamond block from player
    23.                                 set {_book} to enchanted book named "&7Shock"
    24.                                 set line 1 of lore of {_book} to "&7Chance to &estrike lightning &7 on the enemy!"
    25.                                 set line 2 of lore of {_book} to "&eChestplate Enchantment"
    26.                                 give player {_book}
    27.                             if {custom.enchant} is 4:
    28.                                 remove diamond block from player
    29.                                 set {_book} to enchanted book named "&7Afterlife"
    30.                                 set line 1 of lore of {_book} to "&7Restores one heart and applies &einvisibility effect &7to the user on death!"
    31.                                 set line 2 of lore of {_book} to "&eHelmet Enchantment"
    32.                                 give player {_book}
    33.                             if {custom.enchant} is 5:
    34.                                 remove diamond block from player
    35.                                 set {_book} to enchanted book named "&7PLACEHOLDER"
    36.                                 set line 1 of lore of {_book} to "PLACEHOLDER"
    37.                                 set line 2 of lore of {_book} to "PLACEHOLDER"
    38.                                 give player {_book}
    39.                         close player's inventory
    40.                show last gui to player                        
    41. on damage:
    42. #Blindess
    43.         if lore of attacker's weapon contains "&7Blindness":
    44.                 chance of 10%:
    45.                         apply blindess 1 to victim for 2 seconds
    46. #Shock
    47.         if lore of victim's chestplate contains "&7Shock":
    48.                 chance of 5%
    49.                         apply nausea 1 to victim for 2 seconds
    50.                         strike lightning effect at the attacker
    51.                         damage attacker by 1 heart
    52.  
    53. #Afterlife
    54. on death:
    55.         if lore of victim's helmet contains "&7Afterlife":
    56.                 apply instant_health 1 to victim for 1 seconds
    57.                 apply invisibility 1 to victom for 5 seconds
    58.            
    59. every second:
    60.         loop all players:
    61. #Speed
    62.                 if lore of loop-player's boots contains "&7Speed":
    63.                     apply speed 1 to loop-player for 1 seconds
    64.        
    I didn't test this so I don't know if it works or not but try it. (Uninstall skript-tuske and use skript-gui first, if you are using it because I don't remember how skript-tuske works as I used to use that but realized that it has too many bugs so changed to skript-gui)
    Edit: I forgot something so I edited it, still not tested though.
     
    #6 TheCubPlays, Sep 4, 2021
    Last edited: Sep 4, 2021
  8. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    Btw TuSKe has an own custom enchantment feature
     
  9. Brodzy

    Brodzy New Member

    Joined:
    Sep 4, 2021
    Messages:
    8
    Likes Received:
    0
    Thanks you for the advice, I actually had neither tuSKe nor GUI installed and have no installed both, might be a bad idea but I'll soon find out.
    The code above didn't seem to make a different, but thank you for trying.
    --- Double Post Merged, Sep 5, 2021, Original Post Date: Sep 5, 2021 ---
    Sorry, could you expand on that? Not sure what you mean exactly.
    --- Double Post Merged, Sep 5, 2021 ---
    The GUI seems to function nearly as expected, still have the issue of being able to interact with all slots instead of just the nether star but that isn't a major issue. The big issue at the moment is actually applying the effect to the user if their armor or weapon contains the correct lore, such as "&7Afterlife". Reloading the scripts results in error based on the script trying to identify "for 2 seconds"as an entity, as well as not finding the loop for which to apply swiftness to a player.

    Images: Chat error messages & GUI
    txt file: Updated script file
     

    Attached Files:

  10. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
  11. Brodzy

    Brodzy New Member

    Joined:
    Sep 4, 2021
    Messages:
    8
    Likes Received:
    0
    Code (Text):
    1. command /enchanter:
    2.         permission: enchanter.use
    3.         permission message: &cSomething broke...
    4.         trigger:
    5.                 set {_gui} to a new chest inventory with 1 row with name "        &e&k&lAA&r &7&lENCHANTER &e&k&lAA&r"
    6.                 set {_item} to nether star named "&eRandom Custom Enchantment"
    7.                 set line 1 of lore of {_item} to "&7Costs &e1x Diamond Block&7!"
    8.                 set slot 4 of {_gui} to {_item}
    9.                 set {_item} to enchanted book named "&eAvailable enchantments:"
    10.                 set line 1 of lore of {_item} to "&e&lSword &7Crippling"
    11.                 set line 2 of lore of {_item} to "&e&lBoots &7Speed"
    12.                 set line 3 of lore of {_item} to "&e&lChest &7Shockwave"
    13.                 set line 4 of lore of {_item} to "&e&lHelmet &7Escapist"
    14.                 set line 5 of lore of {_item} to "&e&lLegs &7Bounce"
    15.                 set slot 0 of {_gui} to {_item}
    16.                 open {_gui} to player
    17.              
    18. on inventory click:
    19.         if name of event-inventory is "        &e&k&lAA&r &7&lENCHANTER &e&k&lAA&r":
    20.                 if index of event-slot = 4:
    21.                 cancel event
    22.                 if player has diamond block:
    23.                         set {custom.enchant} to random integer between 1 and 5
    24.                         if {custom.enchant} is 1:
    25.                                 remove diamond block from player
    26.                                 set {_book} to enchanted book named "&7Crippling"
    27.                                 set line 1 of lore of {_book} to "&7Chance to apply &eblindess &7and &e slowness effects"
    28.                                 set line 2 of lore of {_book} to "&7on the enemy!"
    29.                                 set line 3 of lore of {_book} to "&eSword Enchantment"
    30.                                 give player {_book}
    31.                                 send "&7Received the &eCrippling&7 Enchantment" to player
    32.                         if {custom.enchant} is 2:
    33.                                 remove diamond block from player
    34.                                 set {_book} to enchanted book named "&7Speed"
    35.                                 set line 1 of lore of {_book} to "&7Applies &espeed effect &7to the user!"
    36.                                 set line 2 of lore of {_book} to "&eBoots Enchantment"
    37.                                 give player {_book}
    38.                                 send "&7Received the &eSpeed&7 Enchantment" to player
    39.                         if {custom.enchant} is 3:
    40.                                 remove diamond block from player
    41.                                 set {_book} to enchanted book named "&7Shockwave"
    42.                                 set line 1 of lore of {_book} to "&7Chance to apply &enausea effect&7 and"
    43.                                 set line 2 of lore of {_book} to "&estrike lightning &7on the enemy!"
    44.                                 set line 3 of lore of {_book} to "&eChestplate Enchantment"
    45.                                 give player {_book}
    46.                                 send "&7Received the &eShockwave&7 Enchantment" to player
    47.                         if {custom.enchant} is 4:
    48.                                 remove diamond block from player
    49.                                 set {_book} to enchanted book named "&7Escapist"
    50.                                 set line 1 of lore of {_book} to "&7Applies &einvisibility &7and &espeed effects"
    51.                                 set line 2 of lore of {_book} to "&7to the user when health reaches three hearts or lower!"
    52.                                 set line 3 of lore of {_book} to "&eHelmet Enchantment"
    53.                                 give player {_book}
    54.                                 send "&7Received the &eEscapist&7 Enchantment" to player
    55.                         if {custom.enchant} is 5:
    56.                                 remove diamond block from player
    57.                                 set {_book} to enchanted book named "&7Bounce"
    58.                                 set line 1 of lore of {_book} to "&7Applies &ejump boost effect &7to the user!"
    59.                                 set line 2 of lore of {_book} to "&eLeggings Enchantment"
    60.                                 give player {_book}
    61.                                 send "&7Received the &eBounce&7 Enchantment" to player
    62.                 close player's inventory
    63.  
    64. on inventory click:
    65.         if cursor slot of player is enchanted book:
    66.                 if name of cursor slot of player is "&7Crippling":
    67.                         if event-item is any swords:
    68.                                 if lore of event-item doesn't contain "&7Crippling":
    69.                                         cancel the event
    70.                                         set {_item} to event-item
    71.                                         remove {_item} from player
    72.                                         add "&7Crippling" to lore of {_item}
    73.                                         give player {_item}
    74.                                         send "&7[&e&lENCHANTER&7] &eCrippling&7 successfully applied!" to the player
    75.                                         set cursor slot of player to air
    76.                 if name of cursor slot of player is "&7Speed":
    77.                         if event-item is any boots:
    78.                                 if lore of event-item doesn't contain "&7Speed":
    79.                                         cancel the event
    80.                                         set {_item} to event-item
    81.                                         remove {_item} from player
    82.                                         add "&7Speed" to lore of {_item}
    83.                                         give player {_item}
    84.                                         send "&7[&e&lENCHANTER&7] &eSpeed&7 successfully applied!" to the player
    85.                                         set cursor slot of player to air
    86.                 if name of cursor slot of player is "&7Shockwave":
    87.                         if event-item is any chestplate:
    88.                                 if lore of event-item doesn't contain "&7Shockwave":
    89.                                         cancel the event
    90.                                         set {_item} to event-item
    91.                                         remove {_item} from player
    92.                                         add "&7Shockwave" to lore of {_item}
    93.                                         give player {_item}
    94.                                         send "&7[&e&lENCHANTER&7] &eShockwave&7 successfully applied!" to the player
    95.                                         set cursor slot of player to air
    96.                 if name of cursor slot of player is "&7Escapist":
    97.                         if event-item is any helmet:
    98.                                 if lore of event-item doesn't contain "&7Escapist":
    99.                                         cancel the event
    100.                                         set {_item} to event-item
    101.                                         remove {_item} from player
    102.                                         add "&7Escapist" to lore of {_item}
    103.                                         give player {_item}
    104.                                         send "&7[&e&lENCHANTER&7] &eEscapist&7 successfully applied!" to the player
    105.                                         set cursor slot of player to air
    106.                 if name of cursor slot of player is "&7Bounce":
    107.                         if event-item is any leggings:
    108.                                 if lore of event-item doesn't contain "&7Bounce":
    109.                                         cancel the event
    110.                                         set {_item} to event-item
    111.                                         remove {_item} from player
    112.                                         add "&7Bounce" to lore of {_item}
    113.                                         give player {_item}
    114.                                         send "&7[&e&lENCHANTER&7] &eBounce&7 successfully applied!" to the player
    115.                                         set cursor slot of player to air
    116.                                        
    117. on damage:
    118.         if lore of attacker's weapon contains "&7Crippling":
    119.                 chance of 10%:
    120.                         apply blindness 1 to victim for 3 seconds
    121.                         apply slowness 2 to victim for 3 seconds
    122.  
    123. on damage:
    124.         if lore of victim's chestplate contains "&7Shockwave":
    125.                 chance of 12%:
    126.                         apply nausea 2 to attacker for 2 seconds
    127.                         strike lightning effect at the attacker
    128.                         damage attacker by 1 heart
    129.                        
    130. on damage:
    131.         if victim's health <= 3:
    132.                 if lore of victim's helmet contains "&7Escapist":
    133.                         apply swiftness 2 to victim for 5 seconds
    134.                         apply invisibility to victim for 5 seconds
    135.                         wait 5 seconds
    136.                         remove swiftness from victim
    137.                
    138. every 2 seconds:
    139.         loop all players:
    140.                 if lore of loop-player's boots contains "&7Speed":
    141.                         apply swiftness 1 to loop-player for 2.01 seconds
    142.  
    143. every 2 seconds:
    144.         loop all players:
    145.                 if lore of loop-player's leggings contains "&7Bounce":
    146.                         apply jump boost 2 to loop-player for 2.01 seconds
    Here's the working Skript if anyone wants to use it
     
Thread Status:
Not open for further replies.

Share This Page

Loading...