You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Can someone explain me why this script cant print anything
What is the issue? Include screenshots / videos if possible!
I’m trying to use a folder to detect a part being added
and then do something with the part
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i looked at the API refrence
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
local Tools = game.Workspace.WorkspaceToolFolder
Tools.ChildAdded:Connect(function(child)
local ToolFound = child:WaitForChild("Tool")
if ToolFound then
print("WE DID IT :)")
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
The problem is that the parameter child is the tool, so you’re trying to find a tool inside of a tool at the moment, all you have to do is remove the ToolFound variable and make the if statement if child then
I’m getting a similar vibe from this code. ChildAdded is triggered, so the child is already loaded. I think they need to change WaitForChild to FindFirstChild.
If that’s the case, the “if child” statement is irrelevant. It should always come back true, right?
I’m assuming the “Tool” child is a kind of OOP safeguard from activating when something else is added to that folder. We would need to see the structure of the folder to know more.