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)
The Player in workspace is called your Player's Character
To access it, you index the Player like; Player.Character
, and it will get the Character in Workspace.
local a = Instance.new("Part", 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) --'hit' would be the Player local torso = hit.Character.Torso --Player.Character.Torso is Torso. torso.CFrame = CFrame.new(7, 5, -55) --CFrame them so they won't die. end workspace.Teleport.ClickDetector.MouseClick:connect(playermover)