Solved WorldGuard + Skript

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

ZoomDK

Member
Sep 19, 2018
13
0
0
20
Does anyone know how "%region at clicked block%" sorts? Like why it says in the order it says.

I have tried a lot of things, but can't really see the pattern.
 
It says a list with all the regions at the clicked block. It always starts with a region, but why that region? I want a specific region to be first.
 
It says a list with all the regions at the clicked block. It always starts with a region, but why that region? I want a specific region to be first.
Does it matter what region is first? You can just use if region at ... contains ... or whatever you want to do with it. If it does matter, tell me why.
 
When you click a certain block, it's going to (areashop) /as addfriend %player% %region at clicked block%. The problem is, when it's not the areashop region first, you're not going to be added.

If I'm going to use contains, I'm going to use a lot of work doing that.
 
When you click a certain block, it's going to (areashop) /as addfriend %player% %region at clicked block%. The problem is, when it's not the areashop region first, you're not going to be added.

If I'm going to use contains, I'm going to use a lot of work doing that.
maybe something like this or?
code_language.skript:
on click:
    clicked block is set
    region at clicked block contains "areashop"
    make player execute command "/as addfriend %player% areashop"
 
Do you have something like a variable, in which you keep all of those plots?
 
They are named b1-200. Not sure what you mean with "variable, in which you keep all of those plots".
 
I could be wrong, but I think it shows regions based on priority... IF you are wanting to set a region to show in the list first.... then you will have to set the priorities of your region.
Also you can use the syntax for checking if region at click block contains "b"
 
They are named b1-200. Not sure what you mean with "variable, in which you keep all of those plots".
Something like this maybe: idk
code_language.skript:
on click:
    clicked block is set
    loop region at clicked block:
        loop-value parsed as "b%integer%" is set
        make player execute command "/as addfriend %player% %loop-value%"
 
"There's no loop that matches 'loop-value parsed as "b%integer%"
[doublepost=1537466349,1537466290][/doublepost]
I could be wrong, but I think it shows regions based on priority... IF you are wanting to set a region to show in the list first.... then you will have to set the priorities of your region.
Also you can use the syntax for checking if region at click block contains "b"

And no, it's not about Priority, already tried.
 
"There's no loop that matches 'loop-value parsed as "b%integer%"
[doublepost=1537466349,1537466290][/doublepost]

And no, it's not about Priority, already tried.
Can you try this for me?
code_language.skript:
on click:
    clicked block is set
    set {_t::*} to region at clicked block
    loop {_t::*}:
        loop-value parsed as "b%integer%" is set
        make player execute command "/as addfriend %player% %loop-value%"
 
"There's no loop that matches 'loop-value' execute console command /as delfriend %player %loop-value%
 
code_language.skript:
on right click on iron door:
    if player can build at event-block:
        wait 1 tick
        toggle event-block
        play sound "BLOCK_IRON_DOOR_OPEN" to player with volume 1 with pitch 5
       
    else if player has permission "guard":
        wait 1 tick
        toggle event-block
        play sound "BLOCK_IRON_DOOR_OPEN" to player with volume 1 with pitch 5
    else if player has permission "officer":
        wait 1 tick
        toggle event-block
        play sound "BLOCK_IRON_DOOR_OPEN" to player with volume 1 with pitch 5
        set {_t::*} to region at clicked block
            loop {_t::*}:
            loop-value parsed as "b%integer%" is set
            make player execute command "/as addfriend %player% %loop-value%"
 
You added one tab too many at the line loop {_t::*}:
 
Try
code_language.skript:
        set {_t::*} to region at clicked block
        loop {_t::*}:
            set {_lv} to "%loop-value%"
            {_lv} parsed as "b%integer%" is set
            make player execute command "/as addfriend %player% %loop-value%"
 
Status
Not open for further replies.