Paste #71823: Untitled Paste

Date: 2020/07/03 01:56:22 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


EditSignsEvents:
    type: world
    debug: false
    events:
        # Abre la interfaz y cambia § a &
        on player right clicks *_sign:
            #- if ( <player.worldguard.can_build[<context.location>]> && <player.has_permission[mcers.signs.edit]> ) || <player.has_flag[admin]>:
            - flag player editSigns:<context.location.sign_contents>
            - adjust <context.location> sign_contents:<context.location.sign_contents.escaped.replace[&ss].with[&amp].unescaped>
            - adjust <player> edit_sign:<context.location>
        # Este evento se dispara cuando el cartel se edita para cambiar los colores
        on player changes sign:
            - if <player.has_flag[editSigns]>:
                - if <player.flag[editSigns]> != <context.new>:
                    # Se guarda la info de quién, cuando y donde edita el cartel
                    - define loc <player.cursor_on.x.round_up>,<player.cursor_on.y.round_up>,<player.cursor_on.z.round_up>
                    - flag server "editSigns_<[loc]>:->:<&a><player.name><&r>. <util.time_now.day>/<util.time_now.month>/<util.time_now.year>, <util.time_now.hour><&co><util.time_now.minute>. <&7>En <context.location.world.name> (<context.location.x.round_up>, <context.location.y.round_up>, <context.location.z.round_up>)"
            - flag player editSigns:!
            - determine <context.new.parse_color>
        # Cuando rompa el cartel se borran los registros de ediciones
        on player breaks *_sign:
            - define loc <player.cursor_on.x.round_up>,<player.cursor_on.y.round_up>,<player.cursor_on.z.round_up>
            - flag server editSigns_<[loc]>:!