Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[ Answered ] How would I check the string chatted by a player before a space?

Asked by 5 years ago
Edited 5 years ago

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?

0
Please provide your answer below, it would make it easier for someone who might end up in the same situation you were in. yyyyyy09 246 — 5y
0
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. gmatchOnRoblox 103 — 5y

Answer this question