Denizen/0.7/Example Scripts/Beginner Scripts: Difference between revisions
From Citizens Wiki
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
*Scripts can be placed in any .yml file in the plugins\Denizen\scripts\ directory | *Scripts can be placed in any .yml file in the plugins\Denizen\scripts\ directory | ||
==Joe the Builder== | ==Joe the Builder== |
Revision as of 03:15, 17 August 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 appeneded 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.
Joe the Builder Script and Assignment |
---|
---- assignments.yml ---- Denizens: 'Steve': #This is the name of the Denizen Interact Scripts: #These are the assigned interact scripts. The number before the script is the priority. - 0 Regular Joe - 10 Joe the Builder ---- script.yml ---- 'Regular Joe': Type: Interact Requirements: #There is no list of requirements, so this script can always be picked. That's why we assign it with low priority. Mode: None Steps: 1: Click Trigger: Script: #This sends a basic message to the interacting player. - CHAT "Hello <PLAYER>! I supply builders only!" 'Joe the Builder': Type: Interact Requirements: Mode: All List:#Here we check if the player has this permission. If he does, this script is selected because it is higher priority. - PERMISSION modifyworld.* Steps: 1: Click Trigger: Script: - ENGAGE #Engage prevents all interaction with this NPC until DISENGAGE is called. - CHAT "Hello <PLAYER> the Builder! Take this shovel!" - GIVE WOOD_SPADE - FINISH #This increments the number of times this script (Joe The Builder) has been completed by this player. - DISENGAGE #This sets the NPC Interactable again. |