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!

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

enchantment request

Discussion in 'Requests' started by titustitus98, Jul 28, 2019.

Tags:
  1. titustitus98

    titustitus98 Active Member

    Joined:
    Feb 19, 2018
    Messages:
    43
    Likes Received:
    0
    Category: enchanting

    Suggested name: enchantment.sk

    Spigot/Skript Version: 2.3.7

    What I want:
    A skript that allows enchanting items using a lore system so that the enchants are binded to the item not the player.

    Ideas for commands:
    /enchant
    Ideas for permissions:
    none
    When I'd like it by: Asap
     
  2. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    81
    Likes Received:
    2
    I don't get what you mean can you be more directly about what you mean? Btw, in normal MC it is already binded to the tool? But do you mean custom enchantments?
     
  3. titustitus98

    titustitus98 Active Member

    Joined:
    Feb 19, 2018
    Messages:
    43
    Likes Received:
    0
    yes I mean custom enchants sorry for not mentioning
     
  4. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    81
    Likes Received:
    2
    What custom enchantments? And do you know how to skript or do you need the full skript?
     
  5. titustitus98

    titustitus98 Active Member

    Joined:
    Feb 19, 2018
    Messages:
    43
    Likes Received:
    0
    I just need one example enchantment such as a speed enchant or something.
     
  6. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    81
    Likes Received:
    2
    Surprisingly this works:
    Code (Text):
    1. every second:
    2.     loop all players:
    3.         set {_p} to loop-player
    4.         loop all items in {_p}'s inventory:
    5.             if lore of loop-item contains "&9Speed modifier":
    6.                 apply speed 1 to loop-player for 1 second
    7.  
    8. command /enchant <text>:
    9.     permission: Enchant
    10.     permission message: &cNo Access
    11.     usage: &cWrite a modifier
    12.     trigger:
    13.         if arg-1 is "Speed":
    14.             set lore of player's tool to "%lore of player's tool% -- &9Speed Modifier &5--"
     
    • Like Like x 1
  7. titustitus98

    titustitus98 Active Member

    Joined:
    Feb 19, 2018
    Messages:
    43
    Likes Received:
    0
    hmm ok but what if I want to make a command "say /speed1" put in the lore "Speed 1" and then increase it by 1 every time the command is executed.
     
  8. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    81
    Likes Received:
    2
    Dude! I got it working:
    Code (Text):
    1. command /enchant <text>:
    2.     permission: Enchant
    3.     permission message: &cNo Access
    4.     usage: &cWrite a modifier
    5.     trigger:
    6.         if arg-1 is "Speed":
    7.             if lore of player's tool contains "&9Speed Modifier":
    8.                 set {_lore} to lore of player's tool
    9.                 replace colored "-- &9speed modifier" in {_lore} with ""
    10.                 replace colored "&5--" in {_lore} with ""
    11.                 replace " " in {_lore} with ""
    12.                 set {_lore} to uncolored "%{_lore}%" parsed as a number
    13.                 add 1 to {_lore}
    14.                 set lore of player's tool to "&5-- &9Speed Modifier %{_lore}% &5--"
    15.             else:
    16.                 set lore of player's tool to "&5-- &9Speed Modifier 1 &5--"
    17.  
    18.  
    19. every second:
    20.     loop all players:
    21.         set {_p} to loop-player
    22.         loop all items in {_p}'s inventory:
    23.             set {_lore} to lore of loop-item
    24.             replace colored "-- &9speed modifier" in {_lore} with ""
    25.             replace colored "&5--" in {_lore} with ""
    26.             set {_lore} to uncolored {_lore} parsed as a number
    27.             if lore of loop-item contains "&9Speed modifier":
    28.                 apply speed {_lore} to loop-player for 1 second
    29.  
     
  9. aescraft

    aescraft Well-Known Member

    Joined:
    Mar 1, 2017
    Messages:
    295
    Likes Received:
    13
    Prob is best to use this instead of "every second" and loop all players.

    Code (Text):
    1. on player's tool change:
    2.     if lore of player's tool contains "&9Speed Modifier":
    3.         set {_lore} to lore of event-item
    4.         replace colored "-- &9speed modifier" in {_lore} with ""
    5.         replace colored "&5--" in {_lore} with ""
    6.         set {_lore} to uncolored {_lore} parsed as a number
    7.         while event-player is holding event-item:
    8.             apply speed {_lore} to event-player for 1 second
    9.             wait 10 ticks
     
  10. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    81
    Likes Received:
    2
    I think he want it like this:
    Code (Text):
    1. command /enchant <text>:
    2.     permission: Enchant
    3.     permission message: &cNo Access
    4.     usage: &cWrite a modifier
    5.     trigger:
    6.         if arg-1 is "Speed":
    7.             if lore of player's tool contains "&9Speed Modifier":
    8.                 set {_lore} to lore of player's tool
    9.                 replace colored "-- &9speed modifier" in {_lore} with ""
    10.                 replace colored "&5--" in {_lore} with ""
    11.                 replace " " in {_lore} with ""
    12.                 set {_lore} to uncolored "%{_lore}%" parsed as a number
    13.                 add 1 to {_lore}
    14.                 set lore of player's tool to "&5-- &9Speed Modifier %{_lore}% &5--"
    15.             else:
    16.                 set lore of player's tool to "&5-- &9Speed Modifier 1 &5--"
    17.         loop all items in player's inventory:
    18.             set {_lore} to lore of loop-item
    19.             replace colored "-- &9speed modifier" in {_lore} with ""
    20.             replace colored "&5--" in {_lore} with ""
    21.             set {_lore} to uncolored {_lore} parsed as a number
    22.             if lore of loop-item contains "&9Speed modifier":
    23.         while loop-item is in player's inventory:
    24.                     apply speed {_lore} to loop-player for 1 second
    25.  
    26.  
    27. on pickup:
    28.     set {_lore} to lore of event-item
    29.     replace colored "-- &9speed modifier" in {_lore} with ""
    30.     replace colored "&5--" in {_lore} with ""
    31.     set {_lore} to uncolored {_lore} parsed as a number
    32.     if lore of event-item contains "&9Speed modifier":
    33.         while event-item is in event-player's inventory:
    34.             apply speed {_lore} to event-player for 1 second
    it has not been tested yet
     
  11. titustitus98

    titustitus98 Active Member

    Joined:
    Feb 19, 2018
    Messages:
    43
    Likes Received:
    0
    ok thanks guys I should prob be able to do my stuff with this, Ill post back if I need any further help.
     
Loading...