- 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


TitleDiff note for paste #12464
TypeDiff
Date2014/12/30 22:47:25 UTC-08:00
ByGuest
Other
Paste
 Sitting:
   Type: Assignment
   Actions:
     On Assignment:
       - Trigger Name:Chat State:true
   Interact Scripts:
   - 100 Sitting Listener
 
 Sitting Listener:
   Type: Interact
   Steps:
     1:
       Chat Trigger:
         1:
           Trigger: /sit/
           Script:
             - flag player sitter:<npc>
             - flag player chatter
             - chat "Ok. Where do you want me to sit?"
 
 #1. Fixed spaceing to only be 2
 #2. Moved the other world event here. no need for another entier script for a single event in this case.
 #3. Changed - flag npc sitloc: to - flag <player.flag[sitter]> sitloc:, It it didn't know what npc to flag.
 
 ChooseBlockListener:
   Type: World
   Events:
     on server start:
     - run timedLoop
 
     On player Clicks Block:
     - if <player.has_flag[chatter]> {
-      - flag <player.flag[sitter]> sitloc:<context.location.sub[-.5,.5,-.5]>
-      - sit <context.location.sub[-.5,.5,-.5]> npc:<player.flag[sitter]>
-      - flag <player.flag[sitter]> sitter
-      - flag chatter:!
+      # added an if check to make sure it is stairs being clicked on.
+      - if <c.location.material.contains[stairs]> {
+        - flag <player.flag[sitter]> sitloc:<context.location.sub[-.5,.5,-.5]>
+        - sit <context.location.sub[-.5,.5,-.5]> npc:<player.flag[sitter]>
+        - flag <player.flag[sitter]> sitter
+        - flag chatter:!
+        } else narrate "<red>This is not a seat."
       }
 
+#removed debug text
 timedLoop:
   type: task
   script:
     - foreach <server.get_npcs_flagged[sitter]> {
       - sit <def[value].flag[sitloc]> npc:<def[value]>
       }
-    - announce "Loop..."
+    - wait 60s
-    - wait 5s
     - inject s@timedLoop
 
 
 
 
 
 
 
 
 
 
 



RawRaw



Pastes made: 59170