Coordinate with directions

  • 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 community!

    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.

Normalguy

Active Member
Apr 19, 2018
98
0
0
hi I want to do like
Set (_loc) to location of 0layer
Wait 10 second
Set(_loc2) to location of player
If difference between north of (_loc) and (_loc2) is more than 10:
Do stuff


I know north of ‘’’’’ doesn’t work can some one help me?
 
Do you want to get the difference between the directions of the location variables, the difference between the locations or the difference between the x coordinates of the locations?
 
code_language.skript:
command /test:
    trigger:
        set {_Loc1} to location of player
        wait 10 seconds
        set {_Loc2} to location of player
        diference between x coordinate of {_loc1} and {_loc2}  > 10:
            send "HALT, you stepped too far"

Not sure if the north location part works, havent tested
Prob wont work because location of player gives a coordinate and not a directional type
 
I want to get the difference between locations
[doublepost=1525183605,1525183500][/doublepost]Can I use angle?
 
I want to get the difference between locations
[doublepost=1525183605,1525183500][/doublepost]Can I use angle?
what do you mean by angle?
Yaw? = the rotation of the player
Pitch? = head tilt up and down
 
Does this work?
On walk:
If player’s angle is 180:
Do stuff
[doublepost=1525217667,1525217637][/doublepost]I want to get direction
 
Maybe Op is going for something like this?
code_language.skript:
command /directionaltest:
    trigger:
        set {_y} to "%player's yaw%"
        set {_p} to "%player's pitch%"
        broadcast "%player% Is looking towards %{_y}% and %{_p}%"
        if player's yaw is greater than 135:
            if player's yaw is less than 225:
                broadcast "Wow, %player%, look at that beautiful sunset! Almost as beautiful as you ;)"
#I understand the sun doesn't set in the North
#Also you this is just an example
 
Status
Not open for further replies.