Jump to content

Chatcolor skript


hengsongquach

Recommended Posts

command /chatcolor:
    permission: chatcolor.use
    aliases: colorrchat, chatcolour, colourchat
    trigger:
        set {_gui} to a chest inventory with 4 rows named "&b&lChatcolours" 
        set slot 0 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 1 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 2 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 3 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 4 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 5 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 6 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 7 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 8 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 9 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 17 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 18 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 25 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 26 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 27 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 28 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 29 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 30 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 31 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 32 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 33 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 34 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 35 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 36 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 37 of {_gui} to brown stained glass pane named "&b&lGens"
        set slot 10 of {_gui} to black stained glass pane named "&0Black"
        set slot 11 of {_gui} to blue stained glass pane named "&1Dark Blue"
        set slot 12 of {_gui} to Green stained glass pane named "&2Dark Green"
        set slot 13 of {_gui} to cyan stained glass pane named "&3Dark Aqua"
        set slot 14 of {_gui} to Purple stained glass pane named "&5Dark Purple"
        set slot 15 of {_gui} to Light Gray stained glass pane named "&7Light Gray"
        set slot 16 of {_gui} to Gray stained glass pane named "&8Dark Gray"
        set slot 19 of {_gui} to Blue stained glass pane named "&9Blue"
        set slot 20 of {_gui} to lime stained glass pane named "&aGreen"
        set slot 21 of {_gui} to light blue stained glass pane named "&bAqua"
        set slot 22 of {_gui} to Red stained glass pane named "&cRed"
        set slot 23 of {_gui} to magenta stained glass pane named "&dLight Purple"
        set slot 24 of {_gui} to yellow stained glass pane named "&eYellow"
        set slot 25 of {_gui} to white stained glass pane named "&fWhite"
        open {_gui} to player


on inventory click:
    if name of event-inventory is "&b&lChatcolours":
        cancel event
        if event-slot is 10:
            set {chatcolor.%player's uuid%} to "&0"
            send "&aYour chat color has been set to &0black&a!" to player
            close player's inventory
        else if event-slot is 11:
            set {chatcolor.%player's uuid%} to "&1"
            send "&aYour chat color has been set to &1dark blue&a!" to player
            close player's inventory
        else if event-slot is 12:
            set {chatcolor.%player's uuid%} to "&2"
            send "&aYour chat color has been set to &2dark green&a!" to player
            close player's inventory
        else if event-slot is 13:
            set {chatcolor.%player's uuid%} to "&3"
            send "&aYour chat color has been set to &3dark aqua&a!" to player
            close player's inventory
        else if event-slot is 14:
            set {chatcolor.%player's uuid%} to "&5"
            send "&aYour chat color has been set to &5dark purple&a!" to player
            close player's inventory
        else if event-slot is 15:
            set {chatcolor.%player's uuid%} to "&7"
            send "&aYour chat color has been set to &7light gray&a!" to player
            close player's inventory
        else if event-slot is 16:
            set {chatcolor.%player's uuid%} to "&8"
            send "&aYour chat color has been set to &8gray&a!" to player
            close player's inventory
        else if event-slot is 19:
            set {chatcolor.%player's uuid%} to "&9"
            send "&aYour chat color has been set to &9blue&a!" to player
            close player's inventory
        else if event-slot is 20:
            set {chatcolor.%player's uuid%} to "&a"
            send "&aYour chat color has been set to &agreen&a!" to player
            close player's inventory
        else if event-slot is 21:
            set {chatcolor.%player's uuid%} to "&b"
            send "&aYour chat color has been set to &baqua&a!" to player
            close player's inventory
        else if event-slot is 22:
            set {chatcolor.%player's uuid%} to "&c"
            send "&aYour chat color has been set to &cred&a!" to player
            close player's inventory
        else if event-slot is 23:
            set {chatcolor.%player's uuid%} to "&d"
            send "&aYour chat color has been set to &dlight purple&a!" to player
            close player's inventory
        else if event-slot is 24:
            set {chatcolor.%player's uuid%} to "&e"
            send "&aYour chat color has been set to &eyellow&a!" to player
            close player's inventory
        else if event-slot is 25:
            set {chatcolor.%player's uuid%} to "&f"
            send "&aYour chat color has been set to &fwhite&a!" to player
            close player's inventory
 

Link to comment
Share on other sites

This code you sent will not work, nor is it very optimized.

Here is a better remake! (its the same gui and everything)


you are welcome to use this as you wish

command /chatcolor:
    permission: chatcolor.use
    aliases: colorrchat, chatcolour, colourchat
    trigger:
        set metadata tag "ChatColorGUI" of player to chest inventory with 4 rows named "&b&lChatcolours"
        set slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 9 and 17 and 18 and 25 and 26 and 27 and 28 and 29 and 30 and 31 and 32 and 33 and 34 and 35 and 36 and 37 of metadata tag "ChatColorGUI" of player to brown stained glass pane named "&b&lGens"
        set slot 10 of metadata tag "ChatColorGUI" of player to black stained glass pane named "&0Black"
        set slot 11 of metadata tag "ChatColorGUI" of player to blue stained glass pane named "&1Dark Blue"
        set slot 12 of metadata tag "ChatColorGUI" of player to green stained glass pane named "&2Dark Green"
        set slot 13 of metadata tag "ChatColorGUI" of player to cyan stained glass pane named "&3Dark Aqua"
        set slot 14 of metadata tag "ChatColorGUI" of player to purple stained glass pane named "&5Dark Purple"
        set slot 15 of metadata tag "ChatColorGUI" of player to light Gray stained glass pane named "&7Light Gray"
        set slot 16 of metadata tag "ChatColorGUI" of player to gray stained glass pane named "&8Dark Gray"
        set slot 19 of metadata tag "ChatColorGUI" of player to blue stained glass pane named "&9Blue"
        set slot 20 of metadata tag "ChatColorGUI" of player to lime stained glass pane named "&aGreen"
        set slot 21 of metadata tag "ChatColorGUI" of player to light blue stained glass pane named "&bAqua"
        set slot 22 of metadata tag "ChatColorGUI" of player to red stained glass pane named "&cRed"
        set slot 23 of metadata tag "ChatColorGUI" of player to magenta stained glass pane named "&dLight Purple"
        set slot 24 of metadata tag "ChatColorGUI" of player to yellow stained glass pane named "&eYellow"
        set slot 25 of metadata tag "ChatColorGUI" of player to white stained glass pane named "&fWhite"
        open (metadata tag "ChatColorGUI" of player) to player


on inventory click:
    if event-inventory = (metadata tag "ChatColorGUI" of player):
        cancel event
        if index of event-slot is 10:
            set {chatcolor::%player's uuid%} to "&0"
            send "&aYour chat color has been set to &0black&a!" to player
            close player's inventory
        else if index of event-slot is 11:
            set {chatcolor::%player's uuid%} to "&1"
            send "&aYour chat color has been set to &1dark blue&a!" to player
            close player's inventory
        else if index of event-slot is 12:
            set {chatcolor::%player's uuid%} to "&2"
            send "&aYour chat color has been set to &2dark green&a!" to player
            close player's inventory
        else if index of event-slot is 13:
            set {chatcolor::%player's uuid%} to "&3"
            send "&aYour chat color has been set to &3dark aqua&a!" to player
            close player's inventory
        else if index of event-slot is 14:
            set {chatcolor::%player's uuid%} to "&5"
            send "&aYour chat color has been set to &5dark purple&a!" to player
            close player's inventory
        else if index of event-slot is 15:
            set {chatcolor::%player's uuid%} to "&7"
            send "&aYour chat color has been set to &7light gray&a!" to player
            close player's inventory
        else if index of event-slot is 16:
            set {chatcolor::%player's uuid%} to "&8"
            send "&aYour chat color has been set to &8gray&a!" to player
            close player's inventory
        else if index of event-slot is 19:
            set {chatcolor::%player's uuid%} to "&9"
            send "&aYour chat color has been set to &9blue&a!" to player
            close player's inventory
        else if index of event-slot is 20:
            set {chatcolor::%player's uuid%} to "&a"
            send "&aYour chat color has been set to &agreen&a!" to player
            close player's inventory
        else if index of event-slot is 21:
            set {chatcolor::%player's uuid%} to "&b"
            send "&aYour chat color has been set to &baqua&a!" to player
            close player's inventory
        else if index of event-slot is 22:
            set {chatcolor::%player's uuid%} to "&c"
            send "&aYour chat color has been set to &cred&a!" to player
            close player's inventory
        else if index of event-slot is 23:
            set {chatcolor::%player's uuid%} to "&d"
            send "&aYour chat color has been set to &dlight purple&a!" to player
            close player's inventory
        else if index of event-slot is 24:
            set {chatcolor::%player's uuid%} to "&e"
            send "&aYour chat color has been set to &eyellow&a!" to player
            close player's inventory
        else if index of event-slot is 25:
            set {chatcolor::%player's uuid%} to "&f"
            send "&aYour chat color has been set to &fwhite&a!" to player
            close player's inventory



on join:
    if {chatcolor::%player's uuid%} is not set:
        set {chatcolor::%player's uuid%} to "&f"
on chat:
	set chat format to "%display name of player% &7» %{chatcolor::%player's uuid%}%%colored message%"

 

spacer.png
 

spacer.png

Link to comment
Share on other sites

no the main problem was that if you selected chatcolor it wouldn't change.
this was because you forgot to add the main part, actually applying the colors. 
(this part)
 

on chat:
	set chat format to "%display name of player% &7» %{chatcolor::%player's uuid%}%%colored message%"
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...