Solved How do I get the Y level?

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

CrimZ0N

Member
Jan 28, 2017
56
3
8
24
Pst, you. Yes you. I need your help.

Basically what I am trying to do is get the Y level/location of the block and then set it to an integer.

I tried doing

Code:
on <event>:
    set event-location's y location to {_height}

But it didn't work :/

Help me and I shall reward you with a like.
 
code_language.skript:
set {_height} to event-location's y-coordinate

code_language.skript:
set {_height} to y-coordinate of event-location

Untested but they should work.
 
  • Like
Reactions: CrimZ0N
code_language.skript:
set {_height} to event-location's y-coordinate

code_language.skript:
set {_height} to y-coordinate of event-location

Untested but they should work.
Well that did solve my question but turns out thats not the way to solve my problem. Well, guess I'm just gonna write 500+ lines of code then.
 
You can also set the y-coordinate if that's what you were looking for

code_language.skript:
set {_height} to event-location's y-coordinate
set {_height} to y-coordinate of event-location

set event-location's y-coordinate to {_height}
set y-coordinate of event-location to {_height}
This is the plugin that was used in that video https://www.spigotmc.org/resources/...ith-region-protection-plugins-supports.32467/

Here is a code for it sweet and simple
code_language.skript:
on place of lava:
    cancel event
    loop blocks downwards:
        if block is not block below event-location:
            if loop-block is not air:
                stop
            else:
                set loop-block to cobblestone
        wait a second

Mark as solved if this fixed your issue. :emoji_stuck_out_tongue:
 
Status
Not open for further replies.