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

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

Asked by
emite1000 335 Moderation Voter
10 years ago

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

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
wait(2)
Workspace.Player1["Left Arm"]:Destroy() -- Below me we both answered the question same time :p

This shall fix it :P

0
i didnt... TochiWasHere 10 — 10y
0
I didn't minus you... HexC3D 830 — 10y
0
then who did .__. TochiWasHere 10 — 10y
0
Not sure why you copied the other person's answer and removed the "()", if you could have just commented on it instead... emite1000 335 — 10y
View all comments (4 more)
0
I DID NOT COPY NEITHER DID HE. HexC3D 830 — 10y
0
i didnt -1 u i plus ones u tho so you wont lose ur hard earned points :3 TochiWasHere 10 — 10y
0
Ah. Well anyway, you need the two parentheses or the script won't work. So technically Tochi is right. emite1000 335 — 10y
0
That's why I hate my typos's HexC3D 830 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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
0
Copy much.... HexC3D 830 — 10y
0
I didn't minus you though It's correct and plus 1 you. HexC3D 830 — 10y
0
I have never even heard of using brackets like that to do parent-child relationships. How do they work? emite1000 335 — 10y
0
i answered that for you TochiWasHere 10 — 10y
View all comments (2 more)
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? emite1000 335 — 10y
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() TochiWasHere 10 — 10y
Log in to vote
0
Answered by 10 years ago
wait(0)
repeat wait(0)until workspace:FindFirstChild("Player")
if workspace.Player:FindFirstChild("Left Arm") then
workspace.Player:FindFirstChild("Left Arm"):remove()
end
0
But why doesn't my original script work? What's wrong with it? emite1000 335 — 10y
0
You did LeftArm when its 'Left Arm'. TheeDeathCaster 2368 — 10y
Log in to vote
0
Answered by 8 years ago
wait(2)
game.Workspace.Player1["Left Arm"]:Destroy()

Answer this question