Solved How to loop blocks that you place?

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

UpdateVersion

New Member
Feb 16, 2018
5
0
0
22
Hello,

I have a problem in my code, and I'm trying to loop blocks that people place and certain blocks, then when they die the blocks get removed.

Code:
on place:
    add location of event-block to {block::%uuid of player%::*}

on death:
    if attacker is a player:
        if victim is a player:
            loop {block::%uuid of victim%}:
                if loop-value is set:
                    set block at loop-value to air

The error is

Can't loop {block::%the UUID of the attacked entity%} because it's only a single value (core.sk, line 58: loop {block::%uuid of victim%}:')

Please, help me as soon as possible, Thanks.
 
Last edited:
do u want to set all the blocks that the victim placed to air?:

Code:
on place:
    add location of event-block to {blocks::%uuid of player%::*}

on death:
    if attacker is a player:
        if victim is a player:
            loop {blocks::%uuid of player%::*}:
                if loop-value is set:
                    set block at loop-value to air

or just the last block he placed?
Code:
on place:
    set location of event-block to {block::%uuid of player%}

on death:
    if attacker is a player:
        if victim is a player:
            set block at {block::%uuid of player%} to air
[doublepost=1557602607,1557602552][/doublepost]Those 2 codes should fix ur problem
If u want to me to make skripts for u, pm me at DragonBlitzz#1733 at discord
 
Dude it is the same i said xD
But the one u said, u only mentioned how to do it if he wants multiple blocks to be removed.
No need for a loop, set block at {var} to air
And the one u have mentioned, he doesn't want (i think) only 1 BLOCK to be set to air. He wants all the blocks that the player placed to be set to air, not just 1
 
But the one u said, u only mentioned how to do it if he wants multiple blocks to be removed.

And the one u have mentioned, he doesn't want (i think) only 1 BLOCK to be set to air. He wants all the blocks that the player placed to be set to air, not just 1
That is what the code does
 
But the one u said, u only mentioned how to do it if he wants multiple blocks to be removed.

And the one u have mentioned, he doesn't want (i think) only 1 BLOCK to be set to air. He wants all the blocks that the player placed to be set to air, not just 1
E.g. `set block at {listvar::*} to air `
 
Status
Not open for further replies.