Event-block's location.

  • 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.
May 12, 2021
27
1
3
24
Code:
on right click:
    if event-block is yellow glass:
        if event-block's x-coordinate is 5:
            if event-block's y-coordinate is 54:
                if event-block's z-coordinate is 2:

Why doesn't this work and could it be more compact?
 
Code:
on right click on yellow glass:
    clicked block's x-coordinate is 5
    clicked block's y-coordinate is 54
    clicked block's z-coordinate is 2
    #action here
 
thanks
[doublepost=1631030442,1630255722][/doublepost]
Code:
on right click on yellow glass:
    clicked block's x-coordinate is 5
    clicked block's y-coordinate is 54
    clicked block's z-coordinate is 2
    #action here

This doesn't work...


Code:
on right click on yellow stained glass:
    clicked block's x-coordinate is 4
    clicked block's y-coordinate is 54
    clicked block's z-coordinate is 8
    send "a" to player
 
Code:
on right click on yellow stained glass:
  set {_loc} to location of event-block
  if {_loc} is "4, 54, 8":
    send "Test was successful" to all players
this should work!
no guarantees
 
Can you send me your errors?

The code works. It just doesn't do anything, there are no errors and it reloads without issue, but when I right click the glass at that location nothing happens.
[doublepost=1631044375,1631044320][/doublepost]I have more than 1 world. This might be the issue.
 
The code works. It just doesn't do anything, there are no errors and it reloads without issue, but when I right click the glass at that location nothing happens.
[doublepost=1631044375,1631044320][/doublepost]I have more than 1 world. This might be the issue.
possibly
 
Code:
on right click on yellow stained glass:
  set {_loc} to location of event-block
  send "%{_loc}%" to all players
  if {_loc} is "":
    send "Test was successful" to all players

When I test this is sends me the coordinates of the saved location. It says "x: 4.5, y: 54.5, z: 8.5" but when I put that in it still doesnt work
 
Code:
on right click on yellow glass:
    location of event-block is location(4.5, 54.5, 8.5, player's world)
    # do stuff
you need to provide decimal values
 
Status
Not open for further replies.