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.

Solved ColorRandomizer

Discussion in 'Requests' started by glowgrew, May 21, 2017.

  1. glowgrew

    glowgrew Active Member

    Joined:
    Jan 26, 2017
    Messages:
    99
    Likes Received:
    7
    Category: ChatDesign
    Suggested name: ColorRandomizer

    What I want: I would like a chat script, which making chat more colourful and simple. On every message it randomize the main color. It can be a function.

    Ideas for commands: -
    Ideas for permissions: -
    When I'd like it by: -

    @BrettPlayMC thanks for the form...
     
  2. Best Answer:
    Post #2 by ShaneBee, May 21, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Like this?

    Code (Skript):
    1. function randomColor(x: int = 0) :: text:
    2.     set {_} to "1|2|3|4|5|6|7|8|9|0|a|b|c|d|e|f"
    3.     set {_x::*} to {_} split at "|"
    4.     return "&%random element out of {_x::*}%"
    5.  
    6. on chat:
    7.     cancel event
    8.     broadcast colored "[%player%] %randomColor()%%message%"
     
    glowgrew likes this.
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Thanks for idea! <3
     

Share This Page

Loading...