Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i define the torso?

Asked by 3 years ago
Edited 3 years ago

i have a script thats supposed to make a part (the scripts parent) look at the closest player, i cant find out how to define the torso tho :(

part = script.Parent
torso = 

while true do
-- Torso and Part defined above as 'torso' and 'part'.

part.CFrame = CFrame.new(part.Position, Vector3.new(torso.Position.X, torso.Position.Y, torso.Position.Z));
wait(0.01)
end

1 answer

Log in to vote
1
Answered by 3 years ago

If You Are Using R6 Do;

local Player = game.Players.LocalPlayer 
local Character = game.Workspace:WaitForChild(Player.Name)

local Torso = Character:WaitForChild('Torso')

But If Your Using R15 Do;

local Player = game.Players.LocalPlayer 
local Character = game.Workspace:WaitForChild(Player.Name)

local UpperTorso = Character:WaitForChild('UpperTorso')
Ad

Answer this question