Chat message letters into separate variables

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

    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!

Luke_Sky_Walker

Well-Known Member
Jul 11, 2023
396
35
28
USA
sites.google.com
Not sure if this is possible, I also couldn't find anything mentioning this sorta thing through research either. But basically what I'm trying to achieve is that if you type a word (Specifically only 5 letters to prevent tons of unnecessary variables) in chat (Example: Place). It will then take every letter of that word and store in into a variable (End result: {test1} would store "P", {test2} would store "L", etc). The issue I have is that I cannot find a way to store each letter of any given word a player types in chat into a var (I also couldn't find any event/condition that could do that sort of thing either). If anyone has any ideas or solutions for this kind of thing, lemme know!
 
Code:
on chat:
    set {_x::*} to message split at ""
    loop {_x::*}:
        set {x%loop-index%} to loop-value

command /output:
    trigger:
        broadcast "%{x1}% %{x2}% %{x3}% %{x4}% %{x5}%"
Is this what you were looking for? Hope it helps! :emoji_slight_smile:
 
  • Like
Reactions: Luke_Sky_Walker