1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help with coordinates

Discussion in 'Skript' started by XpelaajaX, Nov 26, 2022.

Thread Status:
Not open for further replies.
  1. XpelaajaX

    XpelaajaX Member

    Joined:
    Nov 26, 2022
    Messages:
    2
    Likes Received:
    0
    Hi!
    I am creating a maze spawning system using structure blocks and /clone command, but i cant get the coordinates of my loop blocks the right way.

    I want them like this: "15 4 12",but i get them like "15,4 12,5 14,5"

    here's my code:


    command /generate:
    trigger:
    if player is a op:
    if {g::%player%} = "true":
    send "&cGeneraattori pois" to player
    set {g::%player%} to "false"
    else:
    send "&aGeneraattori päällä" to player
    set {g::%player%} to "true"

    on load:
    set {g::%all players%} to "false"

    on click on glowstone:
    if {g::%player%} is "true":
    set {cbl} to event-block's location
    loop all blocks in radius 9 of location of {cbl}:
    if "%loop-block's type%" = "glowstone block":
    set {r} to a random integer between 1 and 13
    set {rplace} to 39+{r}
    set {_x} to loop-block's x-coord
    set {_y} to loop-block's y-coord
    set {_z} to loop-block's z-coord
    send "%{_x}% %{_y}% %{_z}%" to all players
    make console execute command "clone 0 0 %{rplace}% 0 0 %{rplace}% %{_x}% %{_y}% %{_z}%"


    :emoji_smile:
     
  2. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    116
    Likes Received:
    4
    Code (Text):
    1. command /generate:
    2.     trigger:
    3.         if player is a op:
    4.             if {g::%player%} = "true":
    5.                 send "&cGeneraattori pois" to player
    6.                 set {g::%player%} to "false"
    7.             else:
    8.                 send "&aGeneraattori päällä" to player
    9.                 set {g::%player%} to "true"
    10.  
    11. on load:
    12.     set {g::%all players%} to "false"
    13.  
    14. on click on glowstone:
    15.     if {g::%player%} is "true":
    16.         set {cbl} to event-block's location
    17.         loop all blocks in radius 9 of location of {cbl}:
    18.             if "%loop-block's type%" = "glowstone block":
    19.                 set {r} to a random integer between 1 and 13
    20.                 set {rplace} to 39+{r}
    21.                 set {_x} to loop-block's x-coord
    22.                 set {_y} to loop-block's y-coord
    23.                 set {_z} to loop-block's z-coord
    24.                 send "%{_x}% %{_y}% %{_z}%" to all players
    25.                 make console execute command "clone 0 0 %{rplace}% 0 0 %{rplace}% %{_x}% %{_y}% %{_z}%"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...