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

how would i reference the player torso?

Asked by 2 years ago

local torso = game.Players.LocalPlayer.Character:WaitForChild("Torso") this wont work

0
I tested it and it worked. What is the script? RazorXX2 24 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Hello, I am assuming you are using a Local Script. Here's how I would've done it:

--R6
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local torso = character.UpperTorso or character.Torso

If you are using a Server Script then I guess you can use this since LocalPlayer is only for Local Scripts;

game.Players.PlayerAdded:Connect(function(player)
    local character = player.Character or player.CharacterAdded:Wait()
    local torso = character.UpperTorso or character.Torso
end)
Ad

Answer this question