Hi, I'm making my own admin script and currently it's going okay. With string.sub, I can make commands such as ;kill player, but I can't make commands that need more than 1 argument, like ;tp player player.
if string.sub(chat, 1, 4) == (";tp ") then
for i,player in pairs(plr(string.sub(chat, 5))) do
This is part of one of my commands, the "plr" function gets the player (e.g j for John). I'm using string.sub for chat (when the player chats) to see when the player says ";tp " and then getting the player from whatever they type after that (string.sub(chat, 5)). But if I want to put in a second player, how do I do it? The only way I know how is to do something like string.sub(chat, 5, 8) and then the next player string.sub(chat, 9) or something like that, but that would mean if the player enters any more than 3 letters for the player's name for the first player to be teleported it would break.
So with using string.sub, how do I detect when a player puts like a space, and then to get the player after that space? Or any other solution that works? Thank you!

1 comment
http://wiki.roblox.com/index.php?title=Global_namespace/String_manipulation#string.find