local Players = game.Players local player = Players:GetChildren() local pickedPl = player[math.random(1, #player)] local Name = pickedPl.Name Players.Name.Torso.CFrame.new(Vector3.new(216.601, 242.901, -60.497))
It says that 'Name' isn't part of players, but how do I make it so it the script reads the picked players name so it can teleport?
-Update I couldn't think of the correct tag.
local Players = game.Players local player = Players:GetChildren() local pickedPl = player[math.random(1, #player)] pickedPl.Character:MoveTo(Vector3.new(216.601, 242.901, -60.497))
You were trying to teleport the players to a certain part and not using the pickedPL value. You could move the torso I believe but using MoveTo is generally better. Also I don't know what you were trying to do with .Name but if you just used the picked player value it will give you a player.
NOTE: If you want a humanoid inside of a model to walk instead of teleport do
Model.Humanoid:MoveTo(part, part.Position) --When putting in parts for the position to "MoveTo" you are required to put the part and then the part.Position