Paste #81550: Edit of paste 67108: SimpleSitScript

Date: 2021/03/05 02:10:07 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste Edit Of Paste 67108 View Edit Report
Copy Link


#ScriptVer 1.2
#Author Icecapade
#Date 2021-03-05
IcecapadeSitScript:
    type: world
    debug: false
    events:
        on player right clicks *_stairs with:air:
        - if <player.has_flag[is_sit]> || <player.is_sneaking> || <context.location.material.half> == TOP:
            - stop
        - choose <context.location.material.direction>:
            - case NORTH:
                - spawn <context.location.add[0.5,-1.2,0.6]> armor_stand[visible=false;collidable=false;gravity=false] save:armor
                - look <entry[armor].spawned_entity> <context.location.add[0.5,0,1]>
            - case SOUTH:
                - spawn <context.location.add[0.5,-1.2,0.4]> armor_stand[visible=false;collidable=false;gravity=false] save:armor
                - look <entry[armor].spawned_entity> <context.location.add[0.5,0,-1]>
            - case WEST:
                - spawn <context.location.add[0.6,-1.2,0.5]> armor_stand[visible=false;collidable=false;gravity=false] save:armor
                - look <entry[armor].spawned_entity> <context.location.add[1,0,0.5]>
            - case EAST:
                - spawn <context.location.add[0.4,-1.2,0.5]> armor_stand[visible=false;collidable=false;gravity=false] save:armor
                - look <entry[armor].spawned_entity> <context.location.add[-1,0,0.5]>
        - flag server armorstands:<server.flag[armorstands].with[<player>].as[<entry[armor].spawned_entity>]||<map.with[<player>].as[<entry[armor].spawned_entity>]>>
        - mount <player>|<entry[armor].spawned_entity>
        - flag player is_sit
        on player steers armor_stand:
        - if <context.dismount>:
            - define location <context.entity.location.add[0,2.2,0]>
            - inject Icecapade_CancelSitTask
            - teleport <[location]>
        on player quits flagged:is_sit:
        - inject Icecapade_CancelSitTask
        on player enters vehicle flagged:is_sit:
        - inject Icecapade_CancelSitTask
        on player teleports flagged:is_sit:
        - inject Icecapade_CancelSitTask
        on player dies flagged:is_sit:
        - inject Icecapade_CancelSitTask
Icecapade_CancelSitTask:
    type: task
    debug: false
    script:
    - remove <server.flag[armorstands].get[<player>]>
    - flag player is_sit:!
    - flag server armorstands:<server.flag[armorstands].exclude[<player>]>