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

Simplist script in the world and it won't work?

Was helping a friend and have no idea why this doesn't work.

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

It works with Torso and Head but not with Left/RightArm or Left/RightLeg?

So now I know another way to get there, but why does my original script not work?

4 answers

wait(2)
Workspace.Player1["Left Arm"]:Destroy() -- Below me we both answered the question same time :p

This shall fix it :P

8 comments

0

i didnt...

0

I didn't minus you...

0

then who did .__.

0

Not sure why you copied the other person's answer and removed the "()", if you could have just commented on it instead...

0

I DID NOT COPY NEITHER DID HE.

0

i didnt -1 u i plus ones u tho so you wont lose ur hard earned points :3

0

Ah. Well anyway, you need the two parentheses or the script won't work. So technically Tochi is right.

0

That's why I hate my typos's

You see [] means a descendant. It could used to descend through about almost anything i think ._. . Like how you'd say in a table BanHammer[2] (second value in table) so in game objects this is specifically used for objects whose are more than one word or have special characters within them. In game objects tho, they have to be in the form of a string else you could use tostring to turn your returning data to a string but this is ALOT more in-depth than this snippet of code.

wait(2)
Workspace.Player1["Left Arm"]:Destroy()
--we did answer at the same time lel :3

6 comments

0

Copy much....

0

I didn't minus you though It's correct and plus 1 you.

0

I have never even heard of using brackets like that to do parent-child relationships. How do they work?

0

i answered that for you

0

So I could have a Part with Bob in it with a Green in it, and if I just did Workspace.Part["Green"] it would instantly go to the next one and skip the others?

0

if you mean green is a descendant of part then yes the thing about [] is that it cannot locate properties like Workspace.Part["BrickColor"] = BrickColor.Green()

wait(0)
repeat wait(0)until workspace:FindFirstChild("Player")
if workspace.Player:FindFirstChild("Left Arm") then
workspace.Player:FindFirstChild("Left Arm"):remove()
end

2 comments

0

But why doesn't my original script work? What's wrong with it?

0

You did LeftArm when its 'Left Arm'.

wait(2)
game.Workspace.Player1["Left Arm"]:Destroy()

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