I would like to know how to get the players torso. I understand that the player that is indexed in this script is the one here: game.Players.Player but I would like to know how to get the one indexed in game.Workspace.Player.
local a = Instance.new("Part", game.Workspace)
a.Name = "Teleport"
a.Position = Vector3.new(-5.848, 13, -95.462)
a.Anchored = true
local b = Instance.new("ClickDetector", a)
function playermover(hit)
local torso = hit.Torso
torso.Position = CFrame3.new(7, 5, -55)
end
game.Workspace.Teleport.ClickDetector.MouseClick:connect(playermover)

3 comments
Bruhhh thank you so much fr
hitis a bad name for that parameter, since it is equal to the Player object that clicked.hitmakes me think you're going to connect to it a Touched event or something. Since nothing is hit, don't name it 'hit'!It doesn't exactly matter what you name the parameter, but yes it's good practice to name them accordingly to the event / function.