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

how do you find localplayer's torso?

Asked by 7 years ago

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
What type of script are you using? LocalScript or Script? A code like this should be handled in a Local Script. GeezuzFusion 200 — 7y

2 answers

Log in to vote
1
Answered by 7 years ago

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")

Ad
Log in to vote
-1
Answered by 7 years ago
game.Players.LocalPlayer.Character.Torso
0
that's mostly it Credit_worthy -2 — 7y

Answer this question