Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tool ChildRemoved wont print?

Asked by
TechModel 118
2 years ago
Edited 2 years ago

I want this to print locally script in the tool, but it doesn't print at all probably because the tool gets remove before the script runs?

Tool.ChildRemoved:Connect(function()
    print("childgone")
    for _, i in pairs(work:GetDescendants()) do
        if i.Name == "DoorPrompt" then
            i.Enabled = false
        end
    end
    print("child2")
end)

1 answer

Log in to vote
0
Answered by 2 years ago

If you are deleting the tool then yes, the Local Script would be destroyed before it could output anything. I would recommend moving the Local Script to a different place. If you wanted to you could do script:Destroy() once the loop is done. I hope this helped! If it did please mark it as the answer. Good luck and if you need anything else just comment on this or if it doesn't work.

Ad

Answer this question