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

With what can I replace FindFirstChildOfClass?

Asked by 8 years ago

I need to use an different way to do this because FindFirstChildOfClass is disabled for roblox is still working this.

script.Parent.Touched:connect(function(Object)
if  Object.Locked == false then
    Object.Anchored = false 
       if  Object:FindFirstChildOfClass("ManualWeld") then
    local Weld = Object:FindFirstChildOfClass("ManualWeld")
    Weld:destroy()
    end end
end)

1 answer

Log in to vote
0
Answered by 8 years ago

You're going to have to loop through the children of the object manually:

local function FindFirstChildOfClass(object, class)
    for _, child in pairs(object:GetChildren()) do
        if (child:IsA(class)) then
            return child;
        end
    end
end
0
Thanks WITKOSKI 2 — 8y
Ad

Answer this question