set slot {slot} of player to {quantity} {item} named {name} 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.

KroterPvP

Active Member
Apr 10, 2017
178
7
18
22
I'm having errors with this part of code:
code_language.skript:
command /xdlol:
    trigger:
        set {slot} to 4
        set {quantity} to 1
        set {item} to grass
        set {name} to "&6Pistol &8» &avalue"
        set slot {slot} of player to {quantity} {item} named {name}
I tryed using this and it runs
code_language.skript:
set slot {slot} of player to 3 {item} named {name}
Console errors:
code_language.skript:
#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.
 
Change 5th line to:
code_language.skript:
set {item} to "%{quantity}% grass" parsed as item

So in the end that should work with
code_language.skript:
set slot {slot} of player to {item} named {name}
 
Last edited by a moderator:
Change 5th line to:
code_language.skript:
set {item} to "%{quantity}% grass" parsed as item

So in the end that should work with
code_language.skript:
set slot {slot} of player to {item} named {name}
Ok, this works, but I need help doing it with options:
code_language.skript:
options:
    pistol slot: 4
    pistol max ammo: 10
    pistol name: &6Pistol
    pistol item: iron hoe
command /pistol:
    trigger:
        set {pistol.maxammo.%player%} to {@pistol max ammo}
        set {pistol.item} to {@pistol item}
        set {item.%player%} to "%{pistol.maxammo.%player%}% {pistol.item}" parsed as item
        set slot {@pistol slot} of player to {item.%player%} named {@pistol name}
errors:
code_language.skript:
#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)
 
Ok, this works, but I need help doing it with options:
code_language.skript:
options:
    pistol slot: 4
    pistol max ammo: 10
    pistol name: &6Pistol
    pistol item: iron hoe
command /pistol:
    trigger:
        set {pistol.maxammo.%player%} to {@pistol max ammo}
        set {pistol.item} to {@pistol item}
        set {item.%player%} to "%{pistol.maxammo.%player%}% {pistol.item}" parsed as item
        set slot {@pistol slot} of player to {item.%player%} named {@pistol name}
errors:
code_language.skript:
#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)
you forgot percent signs around {pistol.item}
code_language.skript:
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_language.skript:
set {item.%player%} to "%{pistol.maxammo.%player%}% {@pistol item}" parsed as item
EDIT: and you forgot quotes around {@pistol name} in line 11
 
Status
Not open for further replies.