Set pitch and yaw

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

vitusverden

Active Member
Aug 16, 2017
50
2
8
25
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes

So, I have tried searching the forums, and docs, but it did not work the things i found.

I am trying to set the players pitch and yaw, but i cant figure out how to do it.
 
code_language.skript:
        set {_x} to x-coordinate of player
        set {_y} to y-coordinate of player
        set {_z} to z-coordinate of player
        set {_world} to world of player
        set {_yaw} to value
        set {_pitch} to value
        teleport player to location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch})

Maybe this?
 
Setting pitch/yaw directly does only work via NBT editing. Otherwise you'll have to use the methode from qKing above, where you teleport the entity to a location with a new pitch and/or yaw
 
Setting pitch/yaw directly does only work via NBT editing. Otherwise you'll have to use the methode from qKing above, where you teleport the entity to a location with a new pitch and/or yaw


Yeah, I know that I need to teleport - and I can get pitch to work. It is only yaw that does not work.
[doublepost=1535563715,1535555103][/doublepost]
code_language.skript:
        set {_x} to x-coordinate of player
        set {_y} to y-coordinate of player
        set {_z} to z-coordinate of player
        set {_world} to world of player
        set {_yaw} to value
        set {_pitch} to value
        teleport player to location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch})

Maybe this?

I have tried, did not work :emoji_frowning: It didn't send any errors, but it did not work

Code:
code_language.skript:
command /ce [<text>] [<text>] [<integer>]:
    trigger:
        if arg 1 is not set:
            send "{@prefix} &c/ce one (C, CPRE, B, BPRE, A, APRE)&a- Laver en celle"
        else if arg 1 is "one":
            send "Stå stille, laver en celle"
        else if arg 1 is "oneauto":
            set {_x} to x-coordinate of player
            set {_y} to y-coordinate of player
            set {_z} to z-coordinate of player
            set {_world} to world of player
            #set {_yaw} to value
            set {_pitch} to 0
            
            #set {_tploc} to player's location
            #set {_tploc}'s pitch to 0
            #change pitch of {_tploc} to 0
            if player's facing is south:
                set {_yaw} to 0
            if player's facing is west:
                set {_yaw} to 90
            if player's facing is north:
                set {_yaw} to 180
            if player's facing is east:
                set {_yaw} to -90
            #teleport player to {_tploc}
            teleport player to location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch})
            send "%player's facing%"
            send "%player's yaw%"
            send "%{_tploc}'s pitch%"
 
Yeah, I know that I need to teleport - and I can get pitch to work. It is only yaw that does not work.
[doublepost=1535563715,1535555103][/doublepost]

I have tried, did not work :emoji_frowning: It didn't send any errors, but it did not work

Code:
code_language.skript:
command /ce [<text>] [<text>] [<integer>]:
    trigger:
        if arg 1 is not set:
            send "{@prefix} &c/ce one (C, CPRE, B, BPRE, A, APRE)&a- Laver en celle"
        else if arg 1 is "one":
            send "Stå stille, laver en celle"
        else if arg 1 is "oneauto":
            set {_x} to x-coordinate of player
            set {_y} to y-coordinate of player
            set {_z} to z-coordinate of player
            set {_world} to world of player
            #set {_yaw} to value
            set {_pitch} to 0
           
            #set {_tploc} to player's location
            #set {_tploc}'s pitch to 0
            #change pitch of {_tploc} to 0
            if player's facing is south:
                set {_yaw} to 0
            if player's facing is west:
                set {_yaw} to 90
            if player's facing is north:
                set {_yaw} to 180
            if player's facing is east:
                set {_yaw} to -90
            #teleport player to {_tploc}
            teleport player to location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch})
            send "%player's facing%"
            send "%player's yaw%"
            send "%{_tploc}'s pitch%"

I tested your command and, don't know why, it does not work with pitch 0, set it to 1 and it will work
 
Status
Not open for further replies.