Denizen/0.7/Example Scripts/Beginner Scripts: Difference between revisions

From Citizens Wiki

< Denizen‎ | 0.7

No edit summary
Line 19: Line 19:
     Interact Scripts: #These are the assigned interact scripts. The number before the script is the priority.                       
     Interact Scripts: #These are the assigned interact scripts. The number before the script is the priority.                       
       - 0 Regular Joe
       - 0 Regular Joe
       - 10 Joe the Builder   
       - 10 ^Joe the Builder   




Line 32: Line 32:
         Script:  #This sends a basic message to the interacting player.
         Script:  #This sends a basic message to the interacting player.
         - CHAT "Hello <PLAYER>! I supply builders only!"   
         - CHAT "Hello <PLAYER>! I supply builders only!"   
 
      Proximity Trigger:
        Script:  #This sends a basic message to the player when he walks near.
        - CHAT "Hello <PLAYER>! Welcome to <WORLD>!" 
       
'Joe the Builder':
'Joe the Builder':
   Type: Interact   
   Type: Interact   
Line 47: Line 50:
         - CHAT "Hello <PLAYER> the Builder! Take this shovel!"
         - CHAT "Hello <PLAYER> the Builder! Take this shovel!"
         - GIVE WOOD_SPADE
         - GIVE WOOD_SPADE
        - WAIT 1     
        - CHAT "If you have any questions, just say 'help'"
         - FINISH  
         - FINISH  
         #This increments the number of times this script (Joe The Builder) has been completed by this player.
         #This increments the number of times this script (Joe The Builder) has been completed by this player.
         - DISENGAGE   
         - DISENGAGE   
         #This sets the NPC Interactable again.
         #This sets the NPC Interactable again.
      Chat Trigger: #There can be multiple entries under a Chat Trigger or Location Trigger node. Hence the 1: on the next line.
        1:
          Trigger: I need some /help/
          Script:
          - CHAT "Press 'e' to open your inventory, and drag the shovel to your item bar"
          - CHAT "Press the number 1-9 to select the shovel, then start digging!"
</pre>
</pre>
|}
|}

Revision as of 04:30, 1 September 2012

Example scripts are provided with both the assignments and the scripts in the same box. Be sure and put the text in the correct file in your plugins folder.

  • Assignments should always be appended to plugins\Denizen\assignments.yml
  • Scripts can be placed in any .yml file in the plugins\Denizen\scripts\ directory



Joe the Builder

This is the script from the start-up kit. It's 2 interact scripts assigned to 1 Denizen named Steve. He will respond different to a right-click by a player depending on whether or not the player has the modifyworld.* permission.