Hi there
How would I be able to grab, for example, only the second or third word from a TextBox input? I’m pretty sure people were trying to do this before, so I spent some time looking through the Developer Hub and the Forums but couldn’t find any solutions to my question unfortunately.
Example input:
/search info PLAYER_NAME
I now want to grab the player name argument to work with it in a script.
local text = script.Parent.Text -- /search info playername
local arguments = text:split(" ")
for i,v in pairs(arguments) do
print("Argument "..i..": "..v)
end
will output
Argument 1: /search
Argument 2: info
Argument 3: playername