Paste #30623: Edit of P#30160 ThornChat

Date: 2016/02/22 04:10:21 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Chat_Events:
    type: world
    debug: false
    events:
        on player chats:
        - if <player.has_flag[Teams_Player_Menu_Respond]> {
            - determine cancelled passively
            - execute as_player "team <player.flag[Teams_Player_Menu_Respond]> <context.message>"
            - flag player Teams_Player_Menu_Respond:!
            - queue clear
        }
        - if <player.has_flag[Teams_Player_Group]> {
            - if <server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Leaders].contains[<player>]> {
                - determine "FORMAT:Chat_F_InTeam_leader"
            }
            else {
                - determine "FORMAT:Chat_F_InTeam"
            }
        }
        - determine "FORMAT:Chat_F_Normal"
        # Element to change the message. 
        # "FORMAT:" + dScript to set the format script the message should use. 
        # "RECIPIENTS:" + dList(dPlayer) to set the list of players that will receive the message. 
        # <context.message> returns the player's message as an Element. 
        # <context.format> returns the chat message's format. 
        # <context.recipients> returns a list of all players that will receive the chat. 

Chat_F_Normal:
    type: format
    format: "<player.name.display> <&8><&chr[00BB]> <&r><text>"

Chat_F_InTeam:
    type: format
    format: "<s@Teams_Data.yaml_key[config.ranks.colors.<server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank]>].parse_color><player.flag[Teams_Player_Group]> <&r><player.name.display> <&8><&chr[00BB]> <&r><text>"
Chat_F_InTeam_leader:
    type: format
    format: "<s@Teams_Data.yaml_key[config.ranks.colors.<server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank]>].parse_color>*<player.flag[Teams_Player_Group]> <&r><player.name.display> <&8><&chr[00BB]> <&r><text>"