Alright, so this is how SplitMessages work.

So basically, we define the message that the player chats.

So, let’s pretend this is the text we’ve set:

local TextToCheck = "Test me For Text"

Now, what this Split Message does, is it creates a table.

When we say:

msg:split(" ")

What we’re actually doing is we’re looking for the spaces (" ") in the text & then we put each word on it’s own as a value in the table.

So it would essentially become.

local Words = {"Test", "me", "For", "Text"}

Each time we’re saying

SplitMessage[1]

We’re getting the first word from that “invisible” Words list.


In total this is what happens:

local TextToCheck = "Test me For Text"

Then we check the messages for having spaces.

local SplitWords = TextToCheck:split(" ")

Once we’ve done that.

We can get each word from saying.

print(SplitWords[1])

^
This would print “Test”


print(SplitWords[4])

^
This would print “Text”


I hope this helps you understand it!

Please mark this post as solution if it works: