Drawing board (Book or Chat)

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

LimeGlass

VIP
Supporter ++
Regular Diner
Addon Developer
Jan 24, 2017
633
442
73
26
location of "LimeGlass" parsed as player
This is just a simple drawing system using JSON text components from Skellett that I made when testing stuff. lol

Needs Skellett.

Chat:

YyJjd35.png


Book:
nDlLZJc.png


Code:
code_language.skript:
options:
    #Modes are Book or Chat
    #Book will make the drawing in a book
    #Chat will make the drawing in the chat. Pretty simple.
    Mode: "book"
    #If using chat mode. When should the script divide sections.
    Divider: 16
on script unload:
    delete {drawing::*}
command /draw [<text>] [<number>]:
    trigger:
        set {_colours::*} to "&4", "&c", "&6", "&e", "&2", "&a", "&b", "&3", "&1", "&9", "&d", "&5", "&f", "&7", "&8" and "&0"
        if {drawing::player::%player%::selected} is not set:
            set {drawing::player::%player%::selected} to "&0"
        if arg 1 is not set:
            add text component "        &8&l&nDrawing%nl%%nl%    &0&nColour selector%nl%" to {_components::*}
            loop size of {_colours::*} times:
                add 1 to {_number}
                set {_component} to new text component coloured "%{_colours::%{_number}%}%█"
                add click event with action RUN_COMMAND with execute "/draw select %{_number}%" to text component {_component}
                add hover event with action SHOW_TEXT with text "%{_colours::%{_number}%}%&oClick me to select this as your dye." to text component {_component}
                add {_component} to {_components::*}
            add new text component with "%nl%%nl%" to {_components::*}
            if {@Mode} is "chat":
                set {_divider} to {@Divider}
            loop 96 times:
                add 1 to {_slot}
                add 1 to {_divide}
                if {drawing::player::%player%::%{_slot}%} is not set:
                    set {drawing::player::%player%::%{_slot}%} to "&0"
                set {_component} to new text component coloured "%{drawing::player::%player%::%{_slot}%}%█"
                add click event with action RUN_COMMAND with execute "/draw draw %{_slot}%" to text component {_component}
                add {_component} to {_components::*}
                if {_divider} is set:
                    if {_divide} >= {_divider}:
                        clear {_divide}
                        add new text component with "%nl%" to {_components::*}                 
            if {@Mode} is "Book":
                set {_book} to a new written book
                add text components {_components::*} to book {_book}
                open book {_book} to player
            else:
                loop 50 times:
                    message " "
                message text components {_components::*} to player
        else if arg 1 is "clear":
            delete {drawing::player::%player%::*}
            message "&cCleared your drawing"
        else if arg 2 is set:
            if arg 1 is "select":
                set {drawing::player::%player%::selected} to "%{_colours::%arg 2%}%"
            else if arg 1 is "draw":
                set {drawing::player::%player%::%arg 2%} to {drawing::player::%player%::selected}
            execute player command "/draw"
 

Attachments

  • Drawing.sk
    2.4 KB · Views: 577
Last edited: