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

How would I find an object that has no name?

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

✓ Accepted answer
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.

4 comments

0

Eh, nope. Tried both, and the output says "can't index a nil value"

0

Wait, it literally has no name or is the name a space? If there is no name then, make the name a space.

1

You can just remove the space in between the quotes.

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.

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