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

Problem with grouping and shield, how to get it to cover all children?

Asked by 9 years ago

I wish to make a switching shield that is made up of segments but cannot get it to select all the children. This is only to turn the shield on. Help?

Here is the code:

a = script.Parent.Parent.Parent.Holograms.Figure
b = script.Parent.Parent.Parent.Holograms.Shield.SelectChildren
function onClicked()
script.Parent.ClickDetector.MaxActivationDistance = 0 --Prevents accidents
script.Parent.Parent.Scrol.ClickDetector.MaxActivationDistance = 0 --Prevents accidents
a.Name = "Ancient Database: Program 001"
wait(2)
a.Name = "Raising Shield"
function colorAllThePartsIn(parent)
    for _, child in ipairs(parent:GetChildren()) do
        if child:IsA("BasePart") then
            child.Transparency = .3 
            child.CanCollide = true
        elseif child:IsA("Model") then
            colorAllThePartsIn(child) 
        end
    end
end
colorAllThePartsIn(workspace.Model
wait(2)
a.Name = " Nou ani anquitas"
script.Parent.ClickDetector.MaxActivationDistance = 32 --Prevents accidents
script.Parent.Parent.Scrol.ClickDetector.MaxActivationDistance = 32 --Prevents accidents
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)`

Answer this question