Solved Random letter from a player name

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

Cupex

Member
Feb 16, 2020
43
1
8
26
I need help with a script. In the script, a random player should be selected from all players who are on the server. The player's name is then spelled out in a random order in a title until it is fully displayed. Can someone do something like this for me?
I have a video of what it might look like:
 
Code:
command /test:
    trigger:
        set {_length} to length of player's name
        set {_x} to 1
        loop {_length} times:
            set {_chars::%{_x}%} to " "
            add 1 to {_x}
        set {_i::*} to integers between 1 and {_length}
        loop {_length} times:
            set {_e} to a random element of {_i::*}
            set {_x} to character at {_e} in player's name
            set {_chars::%{_e}%} to {_x}
            add {_x} to {_c}
            send title "&eGewinner" with subtitle "&6%join {_chars::*}%" for 1 second with fadein 0 second and fade out 0 second
            remove {_e} from {_i::*}
            wait 0.5 seconds

vanilla skript
 
Thanks very much! It works exactly how I wanted it! But I have one more small question, can you add fireworks sound to all players when the name is complete?
[doublepost=1655556495,1655556396][/doublepost]Forget it, I just found out myself.
 
Status
Not open for further replies.