Paste #5072: Untitled Paste

Date: 2014/06/03 18:12:24 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Normal Chat:
    type: world
    events:
        on player chats:
        - ^if <player.flag[talkingallowed]> {
          - ^flag player lastchat:<context.message>
          - ^run localchatdisplayer
          }
          else {
            - ^if <player.flag[chatblockedreason]> != null {
              - ^narrate "<&7><player.flag[chatblockedreason]>"
              }
        - ^determine cancelled
'localchatdisplayer':
    type: task
    script:
        - ^narrate '<&7>You say, "<player.flag[lastchat]><&7>".'
        - ^flag player "hearsyourmessage:false"
        - ^define closest '<player.location.find.players.within[20]>'
        - ^define second '<player.location.find.players.within[1000]>'
        - ^define third '<player.location.find.players.within[2000]>'
        - ^define fourth '<player.location.find.players.within[3000]>'
        - ^narrate '<player.flag[currentrank]> <&7><player.name> <&7>whispers, "<player.flag[lastchat]>".' t:<%closest%.exclude[<player>]>
        - ^narrate '<player.flag[currentrank]> <&7><player.name> <&7>says, "<player.flag[lastchat]>".' t:<%second%.exclude[%closest%]>
        - ^narrate '<player.flag[currentrank]> <&7><player.name> <&7>yells, "<player.flag[lastchat]>".' t:<%third%.exclude[%second%]>
        - ^narrate '<player.flag[currentrank]> <&7><player.name> <&7>is faintly heard saying, "<player.flag[lastchat]>".' t:<%fourth%.exclude[%third%]>
        - ^if <player.location.find.players.within[3000]> == null narrate "<&7>No one hears you..."