1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Drawing board (Book or Chat)

Discussion in 'Snippets' started by LimeGlass, Jul 6, 2017.

  1. LimeGlass

    VIP Supporter Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    622
    Likes Received:
    438
    Medals:
    This is just a simple drawing system using JSON text components from Skellett that I made when testing stuff. lol

    Needs Skellett.

    Chat:

    [​IMG]

    Book:
    [​IMG]

    Code:
    Code (Skript):
    1. options:
    2.     #Modes are Book or Chat
    3.     #Book will make the drawing in a book
    4.     #Chat will make the drawing in the chat. Pretty simple.
    5.     Mode: "book"
    6.     #If using chat mode. When should the script divide sections.
    7.     Divider: 16
    8. on script unload:
    9.     delete {drawing::*}
    10. command /draw [<text>] [<number>]:
    11.     trigger:
    12.         set {_colours::*} to "&4", "&c", "&6", "&e", "&2", "&a", "&b", "&3", "&1", "&9", "&d", "&5", "&f", "&7", "&8" and "&0"
    13.         if {drawing::player::%player%::selected} is not set:
    14.             set {drawing::player::%player%::selected} to "&0"
    15.         if arg 1 is not set:
    16.             add text component "        &8&l&nDrawing%nl%%nl%    &0&nColour selector%nl%" to {_components::*}
    17.             loop size of {_colours::*} times:
    18.                 add 1 to {_number}
    19.                 set {_component} to new text component coloured "%{_colours::%{_number}%}%█"
    20.                 add click event with action RUN_COMMAND with execute "/draw select %{_number}%" to text component {_component}
    21.                 add hover event with action SHOW_TEXT with text "%{_colours::%{_number}%}%&oClick me to select this as your dye." to text component {_component}
    22.                 add {_component} to {_components::*}
    23.             add new text component with "%nl%%nl%" to {_components::*}
    24.             if {@Mode} is "chat":
    25.                 set {_divider} to {@Divider}
    26.             loop 96 times:
    27.                 add 1 to {_slot}
    28.                 add 1 to {_divide}
    29.                 if {drawing::player::%player%::%{_slot}%} is not set:
    30.                     set {drawing::player::%player%::%{_slot}%} to "&0"
    31.                 set {_component} to new text component coloured "%{drawing::player::%player%::%{_slot}%}%█"
    32.                 add click event with action RUN_COMMAND with execute "/draw draw %{_slot}%" to text component {_component}
    33.                 add {_component} to {_components::*}
    34.                 if {_divider} is set:
    35.                     if {_divide} >= {_divider}:
    36.                         clear {_divide}
    37.                         add new text component with "%nl%" to {_components::*}                
    38.             if {@Mode} is "Book":
    39.                 set {_book} to a new written book
    40.                 add text components {_components::*} to book {_book}
    41.                 open book {_book} to player
    42.             else:
    43.                 loop 50 times:
    44.                     message " "
    45.                 message text components {_components::*} to player
    46.         else if arg 1 is "clear":
    47.             delete {drawing::player::%player%::*}
    48.             message "&cCleared your drawing"
    49.         else if arg 2 is set:
    50.             if arg 1 is "select":
    51.                 set {drawing::player::%player%::selected} to "%{_colours::%arg 2%}%"
    52.             else if arg 1 is "draw":
    53.                 set {drawing::player::%player%::%arg 2%} to {drawing::player::%player%::selected}
    54.             execute player command "/draw"
     

    Attached Files:

    #1 LimeGlass, Jul 6, 2017
    Last edited: Jul 6, 2017
    • Like Like x 2
    • Ducky Ducky x 1
    • Creative Creative x 1

Share This Page

Loading...