A command which sends a message with randomized colors every time

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

KroterPvP

Active Member
Apr 10, 2017
178
7
18
22
Hello, I'm trying to do code a command which sends a message with ramdonized colors. Every time a player executes the command, it sends a message with a random color. How can I do this?

I tried using this, but I can't fix it. I don't know how to make skript read it as color and not as text, because the expresion parsed as color can't be used here.
code_language.skript:
        set {_&} to "1|2|3|4|5|6|7|8|9|0|a|b|c|d|e|f"
        set {_x::*} to {_&} split at "|"
        set {_&x} to "%random element out of {_x::*}%"
        send "&%{_&x}%-------------------------------"
The message apears like that: "&x -------------------------------"
(The x is replaced with a color code)
 
Last edited:
Hello, I'm trying to do code a command which sends a message with ramdonized colors. Every time a player executes the command, it sends a message with a random color. How can I do this?

I tried using this, but I can't fix it. I don't know how to make skript read it as color and not as text, because the expresion parsed as color can't be used here.
code_language.skript:
        set {_&} to "1|2|3|4|5|6|7|8|9|0|a|b|c|d|e|f"
        set {_x::*} to {_&} split at "|"
        set {_&x} to "%random element out of {_x::*}%"
        send "&%{_&x}%-------------------------------"
The message apears like that: "&x -------------------------------"
(The x is replaced with a color code)
do better
code_language.skript:
        set {_&} to "&1|&2|&3|&4|&5|&6|&7|&8|&9|&0|&a|&b|&c|&d|&e|&f"
        set {_x::*} to {_&} split at "|"
        set {_&x} to "%random element out of {_x::*}%"
        send "%colored {_&x}%-------------------------------"
 
do better
code_language.skript:
        set {_&} to "&1|&2|&3|&4|&5|&6|&7|&8|&9|&0|&a|&b|&c|&d|&e|&f"
        set {_x::*} to {_&} split at "|"
        set {_&x} to "%random element out of {_x::*}%"
        send "%colored {_&x}%-------------------------------"
code_language.skript:
return colored "<%a random element out of all enum values of color%>"
 
Hello, I'm trying to do code a command which sends a message with ramdonized colors. Every time a player executes the command, it sends a message with a random color. How can I do this?

I tried using this, but I can't fix it. I don't know how to make skript read it as color and not as text, because the expresion parsed as color can't be used here.
code_language.skript:
        set {_&} to "1|2|3|4|5|6|7|8|9|0|a|b|c|d|e|f"
        set {_x::*} to {_&} split at "|"
        set {_&x} to "%random element out of {_x::*}%"
        send "&%{_&x}%-------------------------------"
The message apears like that: "&x -------------------------------"
(The x is replaced with a color code)
Forgive me because I cannot add tabs on my phone but, this should work.

code_language.skript:
Command /text:
Trigger:
Set {_&} to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or a or b or c or d or e or f
 
Status
Not open for further replies.