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 use ChildAdded for the whole Workspace?

I want to know how I can do childadded for the whole workspace

Like If anything just inside the workspace gets added

I wanna print it

2 answers

✓ Accepted answer

You're looking for the DescendantAdded event!

game.Workspace.DescendantAdded:Connect(function(descendant)
	print(descendant:GetFullName())
end)

this will fire when an object is added into workspace

game.workspace.ChildAdded:Connect(function(object)
	print(object.Name)
end)

If you want to check if a specific instance is added, then add an if statement using :IsA

game.workspace.ChildAdded:Connect(function(object)
	if object:IsA('[Whatever instance you want]') then --
		-- run this code
	end
end)

you can also check the object's name if you are looking to for very specific things

game.workspace.ChildAdded:Connect(function(object)
	if object.Name == '[Any parts name that you are looking for]' then --
		-- run this code
	end
end)

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