Code doesn't work )):

  • 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 community!

    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.

Slowpoke212

Member
Jul 15, 2020
2
0
1
hey so I've been looking through this code and it keeps saying this "loop-block is not a location" no matter what i do

on place:
set {blockOwner::%location of event-block%} to player's uuid
set {blockplaced::%location of event-block%} to true
on break:
if {blockplaced::%location of event-block%} is true:
delete {blockplaced::%location of event-block%}
else if {blockplaced::%location of event-block%} is set:
cancel event
on death of player:
loop all blocks:
if {blockOwner::%location of block at loop-block%} is victim's uuid:
execute console command "setblock %location of block at loop-block% air"
delete {blockplaced::%location of block at loop-block%}
delete {blockOwner::%location of block at loop-block%}
[doublepost=1602614961,1602614485][/doublepost]o wait it didnt send the tabs lmao how do you send code
Code:
on place:
    set {blockOwner::%location of event-block%} to player's uuid
    set {blockplaced::%location of event-block%} to true
on break:
    if {blockplaced::%location of event-block%} is true:
        delete {blockplaced::%location of event-block%}
    else if {blockplaced::%location of event-block%} is set:
        cancel event
on death of player:
    loop all blocks:
        if {blockOwner::%location of block at loop-block%} is victim's uuid:
            execute console command "setblock %location of block at loop-block% air"
            delete {blockplaced::%location of block at loop-block%}
            delete {blockOwner::%location of block at loop-block%}
 
If I were you, I would not create variable {blockplaced::%location of block at loop-block%} and instead of it asked the skript:
Code:
if {blockOwner::%location of event-block%} is set:
Then I would recommend you to make a list of locations, then it's easy to clear:
Code:
on place:
    set {blockOwner::%location of event-block%} to player's uuid
    add location of event-block to {placedblocks::%player%::*}
on death of player:
    loop {placedblocks::%victim%::*}:
        set {_loc} to {placedblocks::%victim%::%loop-index%}
        set block at {_loc} to air
        clear {blockOwner::%{_loc}%}
    clear {placedblocks::%victim%::*}
If you want to make sure this block belongs to your player, you have 2 ways:
Code:
#1.
on break:
    if {blockOwner::%location of event-block%} = player's uuid:
        clear {blockOwner::%location of event-block%}
        remove location of event-block from {placedblocks::%player%::*}
    else if {blockOwner::%location of event-block%} is set:
        cancel event

#2.
on break.
    if {blockOwner::%location of event-block%} is set:
        if {placedblocks::%player%::*} contains location of event-block:
            clear {blockOwner::%location of event-block%}
            remove location of event-block from {placedblocks::%player%::*}
        else:
            cancel event
 
Last edited:
Status
Not open for further replies.