So I'm making a script where you can get the ping of yourself and other players as well. I have the ping for myself done but I'm not sure quite what to do for this part here. I want it to be so you can say !ping play and It'd get the ping of Player1. How would I make it fill in the rest of the players' name.
More examples: !ping xxsa -- would get the ping of xxSalvAGExx
So far I got this.
Player.Chatted:connect(function(Message)
if string.sub(string.lower(Message, 1, 6)) == "!ping " and game.Players:FindFirstChild(string.sub(string.lower(Message, 7))) then
--nothing here yet
end
This works fine but you need to type the players' name fully and correctly which just isn't really what I wanted.

2 comments
Maybe string.find() would fit your needs? https://wiki.roblox.com/index.php?title=Global_namespace/String_manipulation#string.find
Use string.find or string.match, what you're doing right now will only get the player if you supply the full name.