Need help with coordinates

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

XpelaajaX

Member
Nov 26, 2022
2
0
1
Finland
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:
 
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}%"
 
Status
Not open for further replies.