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

How would I find an object that has no name?

Asked by 10 years ago

I need to find an object with 1 space for a name, " ". Obviously I can't do the method of finding it by

game.Workspace. .Humanoid.Health = 80

Is there another way to do this (besides changing the name)?

P.S. The name has to be blank because it is part of a humanoid and I want the humanoid's name to be blank.

1 answer

Log in to vote
2
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago
game.Workspace:FindFirstChild(" ").Humanoid.Health = 80

You can use the find first child method or, you can try this next code.

game.Workspace[" "].Humanoid.Health = 80

Try this one;

ws=game.Workspace:GetChildren()
b=game.Workspace
for i=1, #ws do
if ws[i].Name == "" then
b=ws[i]
end
end
--Your code here, use b to identify them.
0
Eh, nope. Tried both, and the output says "can't index a nil value" whyOmustOitObeOme 7 — 10y
0
Wait, it literally has no name or is the name a space? If there is no name then, make the name a space. M39a9am3R 3210 — 10y
1
You can just remove the space in between the quotes. User#11893 186 — 10y
0
Thanks. I figured out another way, though. I put a script inside the nameless object requesting its parent as a variable (j = script.Parent.Name) and it worked. whyOmustOitObeOme 7 — 10y
Ad

Answer this question