Solved Make player sit on stairs

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

Kampfwombat

Member
Apr 21, 2017
14
0
0
21
Hey, so I just want a skript to make players sit on stairs - right click on a stair to sit on it.
It's probably easy, but I just cant figure out how... (I'm new to skript)
 
spawn a armorstand at stairs
make player ride at armorstand.
finish. you got it.
He is correct, with armor stands it works

code_language.skript:
on rightclick on any stairs:
    spawn armor stand at location below event-block
    set {_entity} to last spawned entity
    set is visible of {_entity} to false
    make player ride {_entity}
    while {_entity} exists:
        if player is sneaking:
            eject any passenger of {_entity}
            wait 2 ticks
            delete {_entity}
        wait 5 tick
 
He is correct, with armor stands it works

code_language.skript:
on rightclick on any stairs:
    spawn armor stand at location below event-block
    set {_entity} to last spawned entity
    set is visible of {_entity} to false
    make player ride {_entity}
    while {_entity} exists:
        if player is sneaking:
            eject any passenger of {_entity}
            wait 2 ticks
            delete {_entity}
        wait 5 tick
Thank you! It works :emoji_slight_smile:
 
He is correct, with armor stands it works

code_language.skript:
on rightclick on any stairs:
    spawn armor stand at location below event-block
    set {_entity} to last spawned entity
    set is visible of {_entity} to false
    make player ride {_entity}
    while {_entity} exists:
        if player is sneaking:
            eject any passenger of {_entity}
            wait 2 ticks
            delete {_entity}
        wait 5 tick
How to let only sit if it's a stair pointing up?
I think as it is, if the player try to sit on a upside down stair, he could do it.
Thanks.
 
Hey, so I just want a skript to make players sit on stairs - right click on a stair to sit on it.
It's probably easy, but I just cant figure out how... (I'm new to skript)

How to let only sit if it's a stair pointing up?
I think as it is, if the player try to sit on a upside down stair, he could do it.
Thanks.
Here's what I came up with when I was helping someone with this the other day. It's rather complete and even stops players from using chairs to glitch through things. The only thing it doesn't do as of now is stop you from using a chair that has a block above it.
code_language.skript:
on right click on stair:
  if player is not sneaking:
    if player's vehicle is not set:
      if data value of clicked block is between 0 and 3:
        cancel the event
        set {_o} to type of clicked block
        spawn 1 armor stand at location 1.7 below and 0.2 in front of event-block
        set {_s} to last spawned entity
        add "{NoGravity:1}" to nbt of {_s}
        add "{Invisible:1}" to nbt of {_s}
        set {_l} to location of player
        make player ride {_s}
        wait 1 tick
        set metadata value "chair" of {_s} to true
        while check [player's vehicle is {_s}]->[{_o} is type of clicked block]:
          wait 1 tick
        set {_k} to method "remove" from {_s}
        set pitch of {_l} to player's pitch
        set yaw of {_l} to player's yaw
        teleport player to {_l}

on packet:
  if event-string is "PacketPlayInSteerVehicle":
    if metadata value "chair" of player's vehicle is true:
      if packet field "d" is true:
        cancel the event
        delete player's vehicle
 
Here's what I came up with when I was helping someone with this the other day. It's rather complete and even stops players from using chairs to glitch through things. The only thing it doesn't do as of now is stop you from using a chair that has a block above it.
code_language.skript:
on right click on stair:
  if player is not sneaking:
    if player's vehicle is not set:
      if data value of clicked block is between 0 and 3:
        cancel the event
        set {_o} to type of clicked block
        spawn 1 armor stand at location 1.7 below and 0.2 in front of event-block
        set {_s} to last spawned entity
        add "{NoGravity:1}" to nbt of {_s}
        add "{Invisible:1}" to nbt of {_s}
        set {_l} to location of player
        make player ride {_s}
        wait 1 tick
        set metadata value "chair" of {_s} to true
        while check [player's vehicle is {_s}]->[{_o} is type of clicked block]:
          wait 1 tick
        set {_k} to method "remove" from {_s}
        set pitch of {_l} to player's pitch
        set yaw of {_l} to player's yaw
        teleport player to {_l}

on packet:
  if event-string is "PacketPlayInSteerVehicle":
    if metadata value "chair" of player's vehicle is true:
      if packet field "d" is true:
        cancel the event
        delete player's vehicle
Which addons do I need for it?
 
Status
Not open for further replies.