So I'm trying to make a GUI where you type in the players name you would like to teleport but so far nothing happens when I do so. The script is located in a button. I am sure I have got my player directly targeted.
playerselect = script.Parent.Parent.PlayerSelect.Text
script.Parent.MouseButton1Down:connect(function()
local choose = script.Parent.Parent:FindFirstChild(playerselect.Text)
for i,v in pairs(game.Players:GetChildren()) do
if v.Name == choose then
local target = v.Character.Torso.Position
script.Parent.Parent.Parent.Parent.Parent.Parent.Character.Torso.Position = CFrame.new(target)
end
end
end)

4 comments
The one problem is would that work as a local script because Im making a game with FE
When your script needs to change something like a part's CFrame, a server script would be best. FilteringEnabled would mess up everything then.
There is surely a way to work around that.
Oh and btw i tried your code without FE in a local script and I got "Argument 1 missing or nil"