#---------------------------------------------+ #Created 24.07.17 - 24.07.17 | #Dorbell by BloodEko | # | #Easy way to add a dorbell | # | #Permission: dorbell.use , OP for admins | # Access to the /dorbell command | # | #---------------------------------------------+ # Usage: /dorbell | # /dorbell set|disable|info | #---------------------------------------------+ #Use /dorbell set while looking at a button | #to assign your dorbell. | #Breaking or /dorbell disable, delete it again| #When players click the dorbell, owner gets | #notified. | #---------------------------------------------+ shelp_reposcripts: type: version author: BloodEko name: Dorbell usage: /dorbell syntax version: 0.6 id: 132 link: http://old.mcmonkey.org/denizen/repo/entry/132 #--------------------------------------------+ dorbell_cmdhandler: type: command name: dorbell usage: /dorbell set|disable|info description: permission: dorbell.use permission message: You don't have the permission for using this command. script: # # /dorbell # - if == 1 { # # set # - if == set { - if ]> && ]> { - narrate "<&4>There is already a dorbell!" } else if !]> { - narrate "<&2>Created a new dorbell!" - flag server dorbell.: - flag server dorbell.: } else { - narrate "<&4>You already have a dorbell!" } } # # info # else if == info { - if ]> { - narrate "<&2>This dorbell is owned by <&6>].as_player.name>" } else if ]> { - narrate "<&2>Your dorbell is located at <&6>]>" } else { - narrate "<&2>You have no dorbell." } } # # disable # else if == disable { - if ]> { - narrate "<&2>Disabled your dorbell." - define location "]>" - flag server dorbell.:! - flag server dorbell.:! } else { - narrate "<&2>You have no dorbell." } } else { - inject locally dorbell_false_syntax } } else { - inject locally dorbell_false_syntax } dorbell_false_syntax: - narrate "<&4>/dorbell set|disable|info" dorbell_handler: type: world events: on player breaks wood_button: - inject locally dorbell_break on player breaks stone_button: - inject locally dorbell_break on player right clicks wood_button: - inject locally dorbell_event on player right clicks stone_button: - inject locally dorbell_event dorbell_event: - if !]> queue clear - if ]> queue clear - flag server dorbell.cooldown. duration:d@4s - if ].as_player.is_online> { - narrate "Ring ring ..." targets: - playsound sound:BLOCK_NOTE_PLING - playsound ]> sound:BLOCK_NOTE_PLING - narrate "<&l><&6>Somebody has used your dorbell!" targets:]> } else { - narrate "Seems like nobody is there." } dorbell_break: - if !]> queue clear - define user ]> - narrate "<&2>Disabled the dorbell from <&6>" - flag server dorbell.:! - flag server dorbell.:!