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

Why do some names work and others don't?

Asked by
emite1000 335 Moderation Voter
10 years ago

Why is it that

wait(2)
Workspace.Player1.Torso:Destroy()

works, but

wait(2)
Workspace.Player1.LeftArm:Destroy()

doesn't? They're the same script but with the body part changed. Why does one work and the other not?

I don't want a script on how to make the second one work, I want to know why it doesn't.

1 answer

Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
10 years ago

You need to put Left Arm In brackets and quotation marks because it's separated by a space. You also remove the dot after it's parent, but not after itself. Like this:

wait(2)
Workspace.Player1["Left Arm"]:Destroy()
0
Ohhh, so Left Arm is a String? I assumed it was one word. Thanks! emite1000 335 — 10y
0
No prob :P dyler3 1510 — 10y
Ad

Answer this question