I want to make it so i can set a players color

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Apr 22, 2020
18
1
3
24
So I'm new to skript and not sure how to do most things
Heres my skript
code_language.skript:
command /color [<string>]:
    trigger:
        arg 1 is "green":
            set {chatcolor.%player%} to "&2"
            send "&eNow you will write in &2green&e!"
        arg 1 is "red":
            set {chatcolor.%player%} to "&4"
            send "&eNow you will write in &4red&e!"
        arg 1 is "lightred":
            set {chatcolor.%player%} to "&c"
            send "&eNow you will write in &clight red&e!"
        arg 1 is "white":
            set {chatcolor.%player%} to "&f"
            send "&eNow you will write in &fwhite&e!"
        arg 1 is "help":
            send "&eUse the command with &c/color <Color>"
        arg 1 is "colors"
        send "{&4Red} {&cLightred} {&2Green} {&fwhite} {&6Gold} {&alightgreen} {&dmagenta} {&5pruple} {&9lightblue} {&1blue} {&bbabyblue} {&3aqua} {&7gray} {&eyellow} {&0black}"
         
on chat:
    cancel event
    broadcast "%coloured player's displayname%&f: %{chatcolor.%player%}%%message%"

I want to make it so I can /color <Players name> <color>
But make a separate thing cause its for operators or people with the permission
 

Attachments

  • upload_2020-4-29_0-54-31.png
    upload_2020-4-29_0-54-31.png
    3.7 KB · Views: 189
Could you maybe explain in a bit more detail, exaclty what you want to be done?
I can maybe be of assistance
 
So what I want to do is have a /color <color> command for players
and have a /color <player name> <color> to set a certain players color with a command

This should do the trick, also I recommend using uuid of player, but that is up to you

Code:
command /color [<text>] [<offline player>]:
    trigger:
        arg 1 is "green":
            set {chatcolor.%player%} to "&2"
            send "&eNow you will write in &2green&e!"
        arg 1 is "red":
            set {chatcolor.%player%} to "&4"
            send "&eNow you will write in &4red&e!"
        arg 1 is "lightred":
            set {chatcolor.%player%} to "&c"
            send "&eNow you will write in &clight red&e!"
        arg 1 is "white":
            set {chatcolor.%player%} to "&f"
            send "&eNow you will write in &fwhite&e!"
        arg 1 is "help":
            send "&eUse the command with &c/color <Color>"
        arg 1 is "colors"
        send "{&4Red} {&cLightred} {&2Green} {&fwhite} {&6Gold} {&alightgreen} {&dmagenta} {&5pruple} {&9lightblue} {&1blue} {&bbabyblue} {&3aqua} {&7gray} {&eyellow} {&0black}"
        arg 2 is set:
            arg 1 is "green":
                set {chatcolor.%uuid of arg 2%} to "&2"
                send "&eNow you will write in &2green&e!"
            arg 1 is "red":
                set {chatcolor.%uuid of arg 2%} to "&4"
                send "&eNow you will write in &4red&e!"
            arg 1 is "lightred":
                set {chatcolor.%uuid of arg 2%} to "&c"
                send "&eNow you will write in &clight red&e!"
            arg 1 is "white":
                set {chatcolor.%uuid of arg 2%} to "&f"
                send "&eNow you will write in &fwhite&e!"
            arg 1 is "help":
                send "&eUse the command with &c/color <Color>"
            arg 1 is "colors"
                send "{&4Red} {&cLightred} {&2Green} {&fwhite} {&6Gold} {&alightgreen} {&dmagenta} {&5pruple} {&9lightblue} {&1blue} {&bbabyblue} {&3aqua} {&7gray} {&eyellow} {&0black}"
        
on chat:
    cancel event
    broadcast "%coloured player's displayname%&f: %{chatcolor.%player%}%%message%"
[doublepost=1588230765,1588230486][/doublepost]just remember to replace either "%uuid of arg 2%" with "%player%, or replace "%player%" with "%uuid of player%"
 
Status
Not open for further replies.