I have a script that is supposed to change the transparency of a group of parts children but at the moment it changes 1 part at a time and since there are tons of parts it takes forever.
So I was wondering if there was a way to change all the children of the model at 1 time?
Heres the code ive got so far!
local Button = script.Parent.PurchaseButton
local NotActivated = true
Button.Touched:Connect(function()
if NotActivated == true then
print("Activated")
NotActivated = false
Button.Transparency = 1
for i,Parts in pairs(script.Parent.MakeshiftMiner:GetChildren()) do
if Parts:IsA("Part" or "UnionOperation" or "WedgePart") then
for i = 1, 0, -.1 do
wait()
Parts.Transparency = i
end
end
end
end
end)
Thank you for your time :)

3 comments
You can just union all the parts together
I'm not sure if it's the best way but http://wiki.roblox.com/index.php?title=Global_namespace/Roblox_namespace#spawn
Problem is line 10; You have to check each one individually. (i.e. if v:IsA('Part') or v:IsA('WedgePart') then -- code end) Also, use
BasePartinstead; it covers all the parts. :)