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

How do I target a Player's limbs?

Asked by
Moosee 62
8 years ago

Whenever I attempt to Target something like a left arm, I can't because it has a space in between Left and Arm, so how do I do it?

2 answers

Log in to vote
6
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
8 years ago

You can access them like you would indices in a table:

player.Character["Left Arm"]
Ad
Log in to vote
0
Answered by
IcyEvil 260 Moderation Voter
8 years ago

MastaJames answered this well, but Im going to give it a shot of my own.

So normally when you are targetting something you would do

Player.Character.Head

but if it has a space in it, it can error. This is incorrect format.

Player.Character.Left Arm

That would error, and right there break your script. So to target the Left Arm, you will need to Add it in this format.

Player.Character["Left Arm"]

This successfully targets the Left Arm, and will not error.

I just took Mastas Answer and Made it longer explaining it in more detail.

Whichever answer you choose to accept will help you in the future.

1
Actually, on the off chance that the Left Arm goes missing, or is renamed sometimes using :fingFirstChild("Left Arm") is a safer bet. OneTruePain 191 — 8y
0
Normally I do use :findFirstChild("Left Arm") but he wanted a direct connection and It was easier to tell him exactly what he wanted. IcyEvil 260 — 8y

Answer this question