Solved Add item to variable block

  • 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.
Apr 12, 2017
36
0
0
24
I am trying to make a skript that makes cobble stone turn to stone, and the results would be put into a chest.

code_language.skript:
aliases:
    any cauldron = 380:0-3
on left click on any cauldron:
    block 1 below is a note block
    player is holding cobble stone
    cancel event
    set {_a} to amount of player's tool
    loop blocks in radius 2:
        loop-block is a chest
        loop-block can hold {_a} of cobble stone
        add 1 to {_chest}
    if {_chest} is 1:
        remove {_a} of cobble stone from player's tool
    if {_chest} is more than 1:
        send "&aMore than 1 chest detected!" to player
    set {_time} to "%{_a}*1.5% seconds" parsed as a timespan
    send "&8Cobble stone will finish crucifying in %{_time}%" to player
    wait {_time}
    send "test1"
    loop blocks in radius 2:
        loop-block is a chest
        loop-block can hold {_a} of stone
        add 1 to {_chest2}
        set {_block} to loop-block
    if {_chest2} is 1:
        add 1 of stone to inventory of {_block}
        send "test"
    if {_chest2} is more than 1:
        drop {_a} of stone at player
        send "&aMore than 1 chest detected!"
The code works, except it does not put stone into the chest. When I substitute {_block} to player on line 26, it puts stone into the player's inventory. Is there a way to do this?
 
I am trying to make a skript that makes cobble stone turn to stone, and the results would be put into a chest.

code_language.skript:
aliases:
    any cauldron = 380:0-3
on left click on any cauldron:
    block 1 below is a note block
    player is holding cobble stone
    cancel event
    set {_a} to amount of player's tool
    loop blocks in radius 2:
        loop-block is a chest
        loop-block can hold {_a} of cobble stone
        add 1 to {_chest}
    if {_chest} is 1:
        remove {_a} of cobble stone from player's tool
    if {_chest} is more than 1:
        send "&aMore than 1 chest detected!" to player
    set {_time} to "%{_a}*1.5% seconds" parsed as a timespan
    send "&8Cobble stone will finish crucifying in %{_time}%" to player
    wait {_time}
    send "test1"
    loop blocks in radius 2:
        loop-block is a chest
        loop-block can hold {_a} of stone
        add 1 to {_chest2}
        set {_block} to loop-block
    if {_chest2} is 1:
        add 1 of stone to inventory of {_block}
        send "test"
    if {_chest2} is more than 1:
        drop {_a} of stone at player
        send "&aMore than 1 chest detected!"
The code works, except it does not put stone into the chest. When I substitute {_block} to player on line 26, it puts stone into the player's inventory. Is there a way to do this?
code_language.skript:
    loop blocks in radius 2:
        loop-block is a chest
        loop-block can hold {_a} of stone
        add 1 to {_chest2}
        set {_block} to loop-block
        set {_loc} to location of loop-block
    if {_chest2} is 1:
        add 1 of stone to inventory of block at {_loc}
        send "test"
    if {_chest2} is more than 1:
        drop {_a} of stone at player
        send "&aMore than 1 chest detected!"

I think this should work
 
Status
Not open for further replies.