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

Is there a way to detect when a model by a specific name is in the workspace?

For what I want to do, I have a script that copies a model I have in lighting, and places the copy into game.Workspace and I need a way to detect it so when the model enters, it runs a function.

1 answer

✓ Accepted answer

To do this, you can use the ChildAdded() event.

game.Workspace.ChildAdded:connect(function(newChild) -- Run when child is added, set newChild as pointer to the child
	if newChild.Name == "blah" then -- If the name of the child is whatever
		yourFunction() -- Run your function
	end
end)

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