Free Lead


Author: aufdemrand
Created: 2013-07-04T11:55:25-0400
Edited: 2013-07-04T11:56:53-0400
Denizen Version: 0.9.1+
Views: 21
Downloads: 888
Likes: 0


WGET
Description: A quick and easy way to make sure your players with horses always have a lead on hand.

This is a small example script that uses world scripts, items scripts, and entity tags.

Type '/l' to get one, but only on your steed!

Note: Requires Denizen 0.9 builds found here:
http://ci.citizensnpcs.com/job/Denizen%20Developmental/

# +-----------------
# | Free Lead
# +
# | A man with a horse should never be without a good lead.
# + 
# | Just use '/l' to get your hands on one -- as long as you're on a horse!
 
 
# Item script defines the material and name of the lead

free lead:
  type: item

  material: leash
  display name: <proc:get_lead_name>

 
# Generate a random name for the lead 

get_lead_name:
  type: procedure

  script:
  - random 3
  - determine "A dingy lead"
  - determine "A rather fine lead"
  - determine "A handmade lead"
 
 
# Handle the 'on command' event to get the lead.

free lead helper:
  type: world

  events:

    # Check if the Player is on a horse when using the /l command.
    # If they are, and they have nothing in their hand, give them
    # a 'free lead'. 
    on l command:
    - if <player.is_inside_vehicle> 
      && <player.get_vehicle.entity_type> == horse
      && <player.item_in_hand.material> == air
      give 'item:i@free lead'
    - determine fulfilled
 




Comments
No one has posted a comment! Post one below: