Help! Message characters

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

Cocoss_SoS

New Member
Mar 27, 2023
6
0
1
23
Hello Skriptors! I have a trouble and I can't solve this. SO

I have a separate sound for each symbol, and I want to make it so that you can combine the symbols together and get a word, but I can’t figure out how to make the left to right each letter in the word read, that is, the sound is played.

Tried to do, but after combining the symbols, the sounds are produced simultaneously and not in order from left to right, but in a different way. I enclose the code and hope for your help :emoji_slight_smile:

Code:
on chat:
    set {checkvoice.counter::%player%} to 1
    set {checkvoice::%player%} to message
    set {checkvoice.lenght::%player%} to length of the message
   
every 3 ticks:
    loop all players in "SCPRP":
        if {checkvoice.counter::%loop-player%} is smaller than or equal to {checkvoice.lenght::%loop-player%}:
            if {checkvoice::%loop-player%} contains "a":
                if {lever.voice::%loop-player%} is true:
                    play sound "mcscprp.alphabet.a" with volume 1 at loop-player
                    add 1 to {checkvoice.counter::%loop-player%}
                    wait 3 ticks
            if {checkvoice::%loop-player%} contains "b":
                if {lever.voice::%loop-player%} is true:
                    play sound "mcscprp.alphabet.b" with volume 1 at loop-player
                    add 1 to {checkvoice.counter::%loop-player%}
                    wait 3 ticks
            if {checkvoice::%loop-player%} contains "c":
                if {lever.voice::%loop-player%} is true:
                    play sound "mcscprp.alphabet.c" with volume 1 at loop-player
                    add 1 to {checkvoice.counter::%loop-player%}
                    wait 3 ticks
            if {checkvoice::%loop-player%} contains "d":
                if {lever.voice::%loop-player%} is true:
                    play sound "mcscprp.alphabet.d" with volume 1 at loop-player
                    add 1 to {checkvoice.counter::%loop-player%}
                    wait 3 ticks
            if {checkvoice::%loop-player%} contains "e":
                if {lever.voice::%loop-player%} is true:
                    play sound "mcscprp.alphabet.e" with volume 1 at loop-player
                    add 1 to {checkvoice.counter::%loop-player%}
                    wait 3 ticks
 
Not entirely sure what you mean. If you're trying to read the letters from left to right, you can loop {checkvoice::%loop-player%} split at "", and every loop-value will be the letter.
 
can u write a code please?
Not entirely sure what you mean. If you're trying to read the letters from left to right, you can loop {checkvoice::%loop-player%} split at "", and every loop-value will be the letter.
 
Sorry for the late reply:
Code:
loop split {checkvoice::%loop-player%} at "":
  send loop-value
Again, every loop will be a letter from the variable, and loop-value will be how you refer to that letter.
 
Sorry for the late reply:
Code:
loop split {checkvoice::%loop-player%} at "":
  send loop-value
Again, every loop will be a letter from the variable, and loop-value will be how you refer to that letter.
Thank you! It works!
 
Status
Not open for further replies.