✓ Accepted answer
Ok so, first you would need to know the player that you want to teleport to. We would simply use a string function called string.sub. There a lot and a lot of dtring fnuctions, string manupilation is really cool and useful.
Check it out.
What string.sub does is, it gives a porition of the given string, it cuts the string starting from a character we can choose and ending at another character we can also choose.
print(string.sub("i like apples", 3, 10))
print(string.sub("i like apples", 3))
And since we know where the player name is going to start from, it's always going to start from the 6th character, so that should be easy.
Another thing, string functions can be found in 2 ways; you can do them this way string.sub() or more simpler a string:sub()
We can now get the player that was written in the command msg, but what about the teleportation.
local player = game.Players.LocalPlayer
player.Chatted:Connect(function(msg)
local target
if msg:lower():match("goto") then
if game.Players:FindFirstChild(msg:sub(6)) then
target = workspace:FindFirstChild(msg:sub(6))
print(target)
player.Character.HumanoidRootPart.CFrame = CFrame.new(target.Head.Position)
end
end
end)
And that should work!
This was tested and it fully work

Now, let me explain some stuff.
msg:lower():match("goto")
print(string.match("i like bloxy cola", "bloxy cola"))
This part doesn't need explaining but i'll show it to you.
if game.Players:FindFirstChild(msg:sub(6)) then
Happy to help!
13 comments
what is wrong with my answer?
u give me a script that works in a completely other way even though i asked help to teleport to any player i type, with ur scrpt its to a player i type in the script and i already got that type
that is completley wrong... did you even try it? just open a server with as many players as you want, and type the command followed by a Player's name, and you'll teleport to him, i tested this, opened a server with 4 people, and it worked.
i did try, otherwise i wouldnt have said that. but fine ill try again
...
wanna help me test it, our game is still not kinda released https://www.roblox.com/games/2965484894/testing-stage
its private i think
no its public
i think only friends of yours can join
hay, try it out now, i did fix this in my test place last night, but i didnt edit my answer, it should 100% work now
check it out
FINALY works now