✓ Accepted answer
Here is the link for string manipulation. Use string.sub and string.find to find what certain parts of the string are. For example, you could use string.sub to find what's after the 6th character in the command "!kill " to see who to kill. You could use string.find to find certain text in the string. Like if you wanted to compare a name prefix to an actual player name (doing "!kill boba" instead of "!kill bobafett3544") by doing something like this (may not work, this is just an idea):
for i, player in pairs(game.Players:GetPlayers()) do
if string.find(player.Name, message) ~= nil then
print(player.Name)
end
end
And even though the above example may not work, I have to type the following because it might work better.
for i, player in pairs(game.Players:GetPlayers()) do
if string.match(player.Name, message.."%w+") == player.Name then
print(player.Name)
end
end
Ok. I've given you two examples. I'm going to create a function to find a player's name based on a prefix, and once I create that function, I will include it in this answer.
Note: There's no function to promote a player in their group if you are in-game. Just thought I'd let you know.
3 comments
Ah fantastic, can't wait for the function. Also, yeah. I know that there is no in-game promotion, I created it using HTTP Service. :)
Awesome! If your method works, please share it with the community. It could really help people out! And, if I answered your question, please mark the answer as accepted. We both get a reputation point.
Oops, yeah. Forgot, haha. Thanks again!