Give a player an amount of item in a variable

  • 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.

K_Abbage

Member
Feb 9, 2022
4
0
1
33
So I am making a custom wood type changer which if you pick up (or have in your inventory) a type of log/planks/sapling it will convert it into the wood type of choice.
Here's my code:
Code:
#1:oak, 2:spruce, 3:birch, 4:jungle, 5:acacia, 6:dark oak
command /woodtypeoak:
    trigger:
        set {woodtype.%player%} to "1"
command /woodtypespruce:
    trigger:
        set {woodtype.%player%} to "2"
command /woodtypebirch:
    trigger:
        set {woodtype.%player%} to "3"
command /woodtypejungle:
    trigger:
        set {woodtype.%player%} to "4"
command /woodtypeacacia:
    trigger:
        set {woodtype.%player%} to "5"
command /woodtypedarkoak:
    trigger:
        set {woodtype.%player%} to "6"
on pickup of oak log:
    if {woodtype.%player%} is not 1:
        set {_woodamount.%player%} to item amount of event-item
        remove all oak logs from the player
        if {woodtype.%player%} is 2:
            give {_woodamount.%player%} spruce logs to the player

So what it does is that it creates multiple commands that choose the wood type which those commands will be activated from a gui. What the bottom part does is when you pick up an amount of oak log, it saves that amount to a local variable, deletes all of those logs and give a specified amount of wood in that variable.
But the console threw this error:
Code:
[16:10:58 ERROR]: Line 25: (woodtype.sk)
    Can't understand this condition/effect: give {_woodamount.%player%} spruce logs to the player
    Line: give {_woodamount.%player%} spruce logs to the player

[16:10:58 INFO]: Loaded 4 scripts with a total of 7 triggers and 7 commands in 0.09 seconds
[16:10:58 INFO]: [Skript] Encountered 1 error while reloading all scripts! (95ms)
Any ways to fix this? Help would be appreciated!
 
Status
Not open for further replies.