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

ChildAdded need help?

im trying to make it so thati can add a if statement into a instience child added but its not working what does work is

player.Backpack.ChildAdded:connect(function(instance)
	if (instance) then

	end
    print(instance.Name .. " added to the workspace")
end)

but thats not really mutch of a if statement im trying to make it so that child added and the name is not Baton then it would print that but i cant figure out how to do this

1 answer

✓ Accepted answer

So, as I understand it, you're trying to check if the new instance's name is "Baton" then print.

Assuming player is defined, all you have to do is check if the Name Property of the new instance is equivelant to "Baton"


player.Backpack.ChildAdded:connect(function(instance)
	if instance.Name == "Baton" then
		print(instance.Name .. " added to the workspace")
	end
end)

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