Solved Help with looping blocks!

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

JTNCrafter

Member
Jan 6, 2018
21
1
3
20
I have looked through the documentary and others, but I need help.

So I want to make it so that if a block is in a specific chunk, it would cancel the event! Kind of like this!

on break:
player is in "{@world}"
loop broken block <<<
if {ffac::%chunk at loop-block%} is set:
if {ffac::%chunk at loop-block%} is not "%{ffac.join.%player%}%":
cancel event
message "{@message} &cYou are breaking claimed land!" to player
message "{@message} &6&lOwner: &a&l%{ffac::%chunk at loop-block%}%" to player

If there are any addons I can use, please tell me. I prefer having no addons.
 
what does "loop broken block" mean. you cant loop one block. if you want to loop blocks in a chunk use this https://docs.skunity.com/syntax/search/block chunk

if you just need to check if the block is in a chunk then idk why you need to loop. line 5 is what you want except no percents and quotes around the second variable
code_language.skript:
if {ffac::%chunk at loop-block%} is not {ffac.join.%player%}:
 
I tried but here is the problem. I want to check if the broken block is in a specific chunk. Let my try to elaborate, If a player breaks a block, I want to either set it's location and do this:
code_language.skript:
[the] block at %number%, %number%, %number% in [chunk] %chunk%

Or, I can loop the block and find if that block is in the chunk:
code_language.skript:
if {ffac::%chunk at loop-block%} is not "%{ffac.join.%player%}%":

Problem is, I do not know how to do either one.

If you can, I also need to do it with placing a block.

Thank you.
 
i told you, the second way is how you do it without the percent signs
code_language.skript:
if {ffac::%chunk at loop-block%} is not {ffac.join.%player%}:
assuming {ffac.join.%player%} is a chunk it will determine if the chunk at the block is the same chunk in the variable
 
If I am correct, first, I need to loop the block, so how can I do that? Thank you for sticking with me so far Donut.
 
Last edited:
you cant "loop one block". looping iterates through a list of things
 
Do you think you can help me finish my skript?

This is a little confusing.
code_language.skript:
on break:
    player is in "{@world}"
    if {ffac::%chunk at player%} is set:
        if {ffac::%chunk at player%} is not "%{ffac.join.%player%}%":
            cancel event
            message "{@message} &cYou are breaking claimed land!" to player
            message "{@message} &6&lOwner: &a&l%{ffac::%chunk at player%}%" to player
           
on place:
    player is in "{@world}"
    if {ffac::%chunk at player%} is set:
        if {ffac::%chunk at player%} is not "%{ffac.join.%player%}%":
            cancel event
            message "{@message} &cYou are placing blocks on claimed land!" to player
            message "{@message} &6&lOwner: &a&l%{ffac::%chunk at player%}%" to player

If I do what I do, if the player is outside of the chunk, he can break the blocks inside of the claimed chunk, even if he is outside. I do not want that. How can I finish this?

If you can help me with just that, I would be done. Thank you Donut.
[doublepost=1515359766,1515357502][/doublepost]This is the hardest part for me so far, I am stumped.
 
Status
Not open for further replies.