Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do you find localplayer's torso?

what I'm currently using only works in studio, is there any way you can get it to work in roblox player?

local player = game.Players.LocalPlayer

local handle = player.Character.Torso

1 comment

1

What type of script are you using? LocalScript or Script? A code like this should be handled in a Local Script.

2 answers

✓ Accepted answer

It doesn't work on game because you are trying to call the players torso before it loads into the game. In the studio it loads before the scripts. But in a real game the character takes longer to load. I suggest using this:

repeat wait() until player.Character

to make the script wait until the character has loaded in

this would pan out to

local player = game.Players.LocalPlayer

repeat wait() until player.Character

local handle = player.Character.Torso

if that doesnt work do

local handle = player.Character:WaitForChild("Torso")

This discussion is preserved as it was. New answers, comments, and votes are closed.