- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleEdit of P#14291 - Edit of P#14289 - Edit of P#14287 - Edit of P#14285 - Edit of P#14283 - Edit of P#
TypeDenizen Script
Date2015/03/05 23:27:38 UTC-08:00
ByGuest
OtherEdit of paste #14291 - click here to see edit details
Paste
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
6500
Morphan1_calico_DoorEvents:
  type: world
  debug: true
  constants:
    directions:
    - 0,0,1
    - 1,0,0
    - 0,0,-1
    - -1,0,0
    - 0,0,-1
    - -1,0,0
    - 0,0,1
    - 1,0,0
  doorclosetimer:
  - if %data% >= 4 && <def[loc].find.players.within[2]||li@> == li@ {
    - switch %loc%
    - if <def[other]||false> {
      - switch %other%
      }
    - queue clear
    }
    else {
    - wait 5s
    - inject locally doorclosetimer 
    }
  events:
    on player right clicks block:
    - if <context.location.material.name.contains[door]> {
      - if <player.is_sneaking> && <context.item||i@air> != i@air {
        - queue clear
        }
      - if <server.list_scripts> contains s@dRegions_CanUse_Block && !<proc[dRegions_CanUse_Block].context[<player>|<c.location>]||false> {
        - queue clear
        }
        else {
        - define loc <context.location.block>
        - define data <def[loc].material.data>
        - if %data% > 7 {
          - define loc <context.location.block.sub[0,1,0]>
          - define data <def[loc].material.data>
          }
        - define direction <script.constant[directions].get[<def[data].add[1]>]>
        - define top_data <def[loc].add[0,1,0].material.data>
        - define other <def[loc].add[%direction%]>
        - define other_top <def[other].add[0,1,0].material.data>
        - if <def[other].material.name.ends_with[door]> && <def[other].material.data> == %data% && %other_top% != %top_data% {
          - switch %other%
          - wait 5s
          - inject locally path:doorclosetimer 
          }
        - define other <def[loc].sub[%direction%]>
        - define other_top <def[other].add[0,1,0].material.data>
        - if <def[other].material.name.ends_with[door]> && <def[other].material.data> == %data% && %other_top% != %top_data% {
          - switch %other%
          - wait 5s
          - inject locally path:doorclosetimer 
          }
          else {
          - wait 5s
          - inject locally path:doorclosetimer 
          }
        }
      }




RawRaw



Pastes made: 62529