Armor stand won't rotate in player's direction

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

Hakuyamu

Member
Oct 29, 2018
33
0
0
Hello everyone,

I have some problems while figuring out how I can set the direction an armor stand is looking.

I need this for a chairs script. It makes a player ride an invisible armor stand when rightclicking a stair. But due to the direction of the armor stand, the legs do not always look as they should. (Screenshots are attached, screenshot1 is where the direction of the armor stand is not as I want it to be, screenshot2 shows a naturally correct armor stand because its default direction when spawned matches the direction of the stairs)

Here is my code:
Code:
on rightclick on stairs:
    if {sitting.%player%} is not set:
        set {sitting.%player%} to true
        spawn armor stand at location 1.8 below and 0.1 in front of clicked block
        set {_seat} to last spawned armor stand
        add "{Invisible:1}" to nbt of {_seat}
        add "{NoGravity:1}" to nbt of {_seat}
        set {seat.back.%player%} to player's location
        make player ride {_seat}
        while player's vehicle is {_seat}:
            set yaw of player's vehicle to player's yaw
            wait 3 ticks

Hope someone can help me with this.
 

Attachments

  • screenshot1.png
    screenshot1.png
    160.2 KB · Views: 328
  • screenshot2.png
    screenshot2.png
    116.2 KB · Views: 259
try using {_seat} instead of player's vehicle

EDIT:
If that doesn't work, try setting a local variable to the player's yaw then set the player's vehicle (or {_seat})'s yaw to that local variable
 
Last edited:
Doesn't work either. I even cannot set the yaw to an absolute value, the direction of the armor stand wont change at all..
 
Status
Not open for further replies.