Paste #4031: Edit of P#4030 - Script re-paste from http://scripts.citizensnpcs.co/view/0huh0g

Date: 2014/05/03 15:41:45 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#You need to have a inventory for the script to use
#Change the chest definition to where you want it to be.
players:
    type: world
    events: 
        on players command:
        - define chest '376.0,76.0,239.0,keangdom'
        - inventory open d:in@location[holder=l@%chest%]
        - inventory clear d:in@location[holder=l@%chest%]
        - inventory add d:in@location[holder=l@%chest%] o:i@sign[display_name=Player_List;lore=Click_on_a_player_to|request_a_teleport.]
        - foreach <player.list.online> {
          - flag global skull:%value%
          - if <p@%value%.flag[pvp]> flag global item:witherskeleton_skull
            else flag global item:human_skull
          - inventory add d:in@location[holder=l@%chest%] o:i@playerskull
          }
        - determine FULFILLED

#A very customized skull item
playerskull:
    type: item
    material: <global.flag[item]>
    display name: <global.flag[skull]>
    lore:
    - "Name: <light_purple><p@<global.flag[skull]>.name.display>"
    - "Health: <light_purple><p@<global.flag[skull]>.health>"
    - "Money: <light_purple><p@<global.flag[skull]>.money>"
    - "World: <light_purple><p@<global.flag[skull]>.location.world>"
    - "Cords; <light_purple>X:<p@<global.flag[skull]>.location.x.as_int>, Y:<p@<global.flag[skull]>.location.y.as_int>, Z:<p@<global.flag[skull]>.location.z.as_int>"
    - "Corpse: <light_purple><p@<global.flag[skull]>.flag[body]>"
    no_id: true

#Stops players from taking the skulls out of the display.
#Runs a tpa command when a player skull is clicked on
#Runs a tp command if the player has custom.admin permission.
playersinventory:
    type: world
    events:
        on player clicks in inventory:
#Debugging        - announce "<context.item>"
        - if <context.inventory> == in@location[holder=l@%chest%] {
          - if <context.item.has_display> {
            - if <player.has_permission[custom.admin]> execute as_player "tp <context.item.display>"
              else execute as_player "tpa <context.item.display>"
            }
          - determine CANCELLED
          }