Paste #30684: Untitled Paste

Date: 2016/02/23 08:47:40 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


"PK_interact":
    type: interact

    steps:
    # This step is a Jumping off point for ways the NPC interacts with you. By placing different types of triggers
    # inside of the steps it can be a way to make One character more varried.
        '1':
            proximity trigger:
                entry:
                    script:
                    # When a player enters the Proximity Range it will fire a script located lower down.

                    - if <player.has_flag[BeingAttacked]> {
                      - narrate format:GuardChat "Looks like you got this covered."
                      - queue stop
                      }

                    - if <player.gamemode> == "SURVIVAL" {
                      - if !<player.has_flag[listening]> {
                          - inject PK_weapon_check
                          - queue clear
                      }
                    }


"PK_weapon_check":
    type: task
    script:
    #- narrate format:GuardChat "Doing weapon check!."
    - walk <player.location>
    - if <global.flag[weapons].as_list> contains <player.item_in_hand.material.name> {
        - if !<player.has_flag[listening]> {
          - flag <player> listening duration:10s
          - flag <player> hated duration:2m
          - pause waypoints
          - lookclose <npc> state:true realistic
          - inject PK_warning
          }
        }

"PK_warning":
    type: task
    script:
      - pause waypoints 
      - lookclose <npc> state:true realistic

      - walk <player.location>
      - wait 1
      - narrate format:GuardChat "<player.name>, you've been warned! This Prison does not allow weapons."
      - playsound <npc.location> Grille_confiscate.weapons volume:2.0 pitch:1.0 custom

      - run PK_attack
    #    }


-----
and the run attack basically works ok.. just don't want several NPCs all trying to attack (and talk) at the same time.. though I know the NPCs will help each other if they are in proximity and someone(npc) is being attacked.. I just don't want any scripts running on second and third NPCs...