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

With what can I replace FindFirstChildOfClass?

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

✓ Accepted answer

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

1 comment

0

Thanks

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