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.

set slot {slot} of player to {quantity} {item} named {name} ERROR

Discussion in 'Skript' started by KroterPvP, Jul 16, 2017.

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

    KroterPvP Active Member

    Joined:
    Apr 10, 2017
    Messages:
    178
    Likes Received:
    7
    I'm having errors with this part of code:
    Code (Skript):
    1. command /xdlol:
    2.     trigger:
    3.         set {slot} to 4
    4.         set {quantity} to 1
    5.         set {item} to grass
    6.         set {name} to "&6Pistol &8» &avalue"
    7.         set slot {slot} of player to {quantity} {item} named {name}
    I tryed using this and it runs
    Code (Skript):
    1. set slot {slot} of player to 3 {item} named {name}
    Console errors:
    Code (Skript):
    1. #a slot can't be set to '{quantity} {item} named {name}' because the latter is neither an item type nor an item stack
    This means that the item I'm trying to give 2 times can't be stacked, but I still can't give the item setting {quantity} to 1. (the stone can be stacked, Idk what's hapening).
    I don't know why it's not running. I think it's a bug... I'm using Skellett, SkQuerry 3, skript bensku's edit 27 dev, minecraft 1.8.8.
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Try
    Code (Skript):
    1. {quantity} of {item}
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Change 5th line to:
    Code (Skript):
    1. set {item} to "%{quantity}% grass" parsed as item
    So in the end that should work with
    Code (Skript):
    1. set slot {slot} of player to {item} named {name}
     
    #3 ShaneBee, Jul 16, 2017
    Last edited by a moderator: Jul 16, 2017
    • Agree Agree x 1
  4. KroterPvP

    KroterPvP Active Member

    Joined:
    Apr 10, 2017
    Messages:
    178
    Likes Received:
    7
    Ok, this works, but I need help doing it with options:
    Code (Skript):
    1. options:
    2.     pistol slot: 4
    3.     pistol max ammo: 10
    4.     pistol name: &6Pistol
    5.     pistol item: iron hoe
    6. command /pistol:
    7.     trigger:
    8.         set {pistol.maxammo.%player%} to {@pistol max ammo}
    9.         set {pistol.item} to {@pistol item}
    10.         set {item.%player%} to "%{pistol.maxammo.%player%}% {pistol.item}" parsed as item
    11.         set slot {@pistol slot} of player to {item.%player%} named {@pistol name}
    errors:
    Code (Skript):
    1. #a slot can't be set to '{item.%player%} named &6Pistol' because the latter is neither an item type nor an item stack (line 11)
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    you forgot percent signs around {pistol.item}
    Code (Skript):
    1. set {item.%player%} to "%{pistol.maxammo.%player%}% %{pistol.item}%" parsed as item
    Although idk why you even have the variable {pistol.item}. you could just:
    Code (Skript):
    1. set {item.%player%} to "%{pistol.maxammo.%player%}% {@pistol item}" parsed as item
    EDIT: and you forgot quotes around {@pistol name} in line 11
     
Thread Status:
Not open for further replies.

Share This Page

Loading...