I'm making chat commands, and I'm trying to print text that is between two double quotes, as shown in the script below.
admins = {
["alienantics"] = true;
};
game.Players.PlayerAdded:connect(function(player)
if admins[player.Name] then
player.Chatted:connect(function(msg)
if msg:sub(1, 7) == "-print " then -- player would type in something like -print "this is text"
local text_marker = '"';
local start, finish = msg:find(text_marker);
print(msg:sub(start + 1));
end
end)
end
end)
Now, if I wrote that code correctly it should print something along the lines of...
this is text"
But you may notice that the last double quote is printed, which I do not want. I'm not sure exactly how to go about solving this. As much as I love programming, logical thinking and breaking things down still proves difficult for me at times.

2 comments
Yeah, I've noticed that it only finds the first occurrence. I'm still not sure how what you've suggested will work unless the player types in something of that exact length each time.
It isn't defined to a specific length. It takes the structure you had (-print "Type text here") and allows anyone to type as much as they want imbewteen the quotation marks. If you test out my code, you will see what I mean.