I figured out how to do this on my own, ignore this question lol
Basically I'm workin on an admin script that bans players and allows admins to ban them with a reason. i.e ":ban [user] [reason]". I've currently been able to remove ":ban" from the string so that I could extract the first combind text (as in without a space) as their username. The only downside is that I don't know how to check if it's before the spacebar. I'm not sure if I'm explaining this correctly tbfh. Here's an example.
Ex.
- Player types ":ban ROBLOX exploiting"
- string.sub removes ":ban" from the string so now it's just "ROBLOX exploiting"
How would I detect that the first text is the username and the second is the reason?

2 comments
Please provide your answer below, it would make it easier for someone who might end up in the same situation you were in.
That'd mean I'd have to paste all 3 variables along with the chatted function so pretty much my entire script just for someone who MIGHT need this in the future, I'd rather not.