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 Give enchanted Item to player

Discussion in 'Skript' started by HumbleMC, Nov 9, 2018.

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

    HumbleMC Member

    Joined:
    Nov 8, 2018
    Messages:
    18
    Likes Received:
    1
    Hi all, looking to give enchanted items to player but it's not working? I have no errors either.

    Here is my current code:
    Code (Skript):
    1.     trigger:
    2.         set {_player.player} to arg 1
    3.         set {_playerText} to "%arg 1%"
    4.         set {_amount} to arg 2
    5.         give {_amount} of Diamond Sword of sharpness 4 to {_player.player}
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,178
    Likes Received:
    218
    Your code is cut off, its missing the command.
     
  3. HumbleMC

    HumbleMC Member

    Joined:
    Nov 8, 2018
    Messages:
    18
    Likes Received:
    1
    Hey no I do have the command above i just copied the trigger.

    Code (Skript):
    1. command /BcMasterSlayer <player>, <number>:
    2.     description: Give players MasterSlayers.
    3.     aliases: BcMasterSlayer
    4.     usage: /BcMasterSlayer <player>, <value 0 or 1>
    5.     permission: donate.masterslayer
    6.     trigger:
    7.         set {_player.player} to arg 1
    8.         set {_playerText} to "%arg 1%"
    9.         set {_amount} to arg 2
    10.         give {_amount} of Diamond Sword of sharpness 4 to {_player.player}
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,178
    Likes Received:
    218
    remove the comma from your command and try change number to integer
    also you can do
    Code (Skript):
    1. give arg-2 of diamond sword of sharpness 4 to arg-1
     
  5. HumbleMC

    HumbleMC Member

    Joined:
    Nov 8, 2018
    Messages:
    18
    Likes Received:
    1
    I just tried that now and it is giving me a diamond sword with no enchantment on it?
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,178
    Likes Received:
    218
    Which version of Spigot are you using?
    And which version of Skript?
    (Please answer without saying "latest")
     
  7. HumbleMC

    HumbleMC Member

    Joined:
    Nov 8, 2018
    Messages:
    18
    Likes Received:
    1
    Spigot : 1.13.2
    Skript: Not sure but I got it from here: https://github.com/SkriptLang/Skript/releases
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,178
    Likes Received:
    218
    #1 You really should know which version you are using. If you dont know you can do /ver Skript (I recommend knowing what you are putting on your server) Im guessing you're probably using 2.2 Beta1 or 2
    anyways
    try this:
    Code (Skript):
    1. set {_item} to diamond sword
    2. enchant {_item} with sharpness 4
    3. give arg-1 arg-2 of {_item}
     
  9. HumbleMC

    HumbleMC Member

    Joined:
    Nov 8, 2018
    Messages:
    18
    Likes Received:
    1
    I am using 2.3-beta2

    Thanks for the help I will try that code now!
     
  10. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,178
    Likes Received:
    218
    Awesome.
    Im using the same version, tested your code (which like you said didn't work) and tested the code I wrote, which worked.
     
  11. HumbleMC

    HumbleMC Member

    Joined:
    Nov 8, 2018
    Messages:
    18
    Likes Received:
    1
    Just tested your code there works perfectly :emoji_slight_smile: Thanks a lot man! <3
     
  12. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,178
    Likes Received:
    218
    You're very welcome.
     
  13. HumbleMC

    HumbleMC Member

    Joined:
    Nov 8, 2018
    Messages:
    18
    Likes Received:
    1
    another thing sorry, just naming the item?
     
  14. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,178
    Likes Received:
    218
    depends in which way you mean, but you can do something like this
    Code (Skript):
    1. set {_item} to diamond sword named "NAME HERE"
     
  15. HumbleMC

    HumbleMC Member

    Joined:
    Nov 8, 2018
    Messages:
    18
    Likes Received:
    1
    Thanks a million man!!
     
  16. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,178
    Likes Received:
    218
    You're very welcome :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...