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

How to indicate LocalPlayer in Workspace?

Asked by 6 years ago

im creating an animation and i wanted to indicate "LeftHand" (R15). (if my grammar is bad, i dont speak your language.)

1 answer

Log in to vote
0
Answered by
theCJarmy7 1293 Moderation Voter
6 years ago

Don't worry, your grammar is actually a lot better than some other people on this site. As for getting the player Character (what I assume you mean by the player in the workspace) you would run something like this:

local player = game.Players.LocalPlayer
local char = player.Character

Now that's all well and good, but the variable char will hold nil because the player object in Players loads in before the character loads, now, some people have different (and probably better) methods for getting around this, but I use this:

local player = game.Players.LocalPlayer
repeat wait() until player.Character
--waits until the character loads in
local char = player.Character

And there you have it.

0
It Worked! Thank you HeisukeKexji 8 — 6y
Ad

Answer this question