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

How to make a group transparent??

Asked by 4 years ago

I'm trying to make it so that when you click a group of objects the transparency of the group changes. I've tried:

local Group = script.Parent

function onClick(brick)
    Group.Transparency = 1
end

I looked for tutorials everywhere but nobody is showing what I'm trying. Help?

1 answer

Log in to vote
0
Answered by 4 years ago

So put the parts inside a model and name the model whatever you want, then with the button you want to use to make these parts invisible, insert a script and a click detector. open the script and paste this :

local Group = script.Parent.Parent.PARTSGROUP:GetChildren() ---Name of the model the parts are in (Get children gets everything inside the model)
 function onClick()
for _,v in pairs(Group) do
        v.Transparency = 1



    end
end
script.Parent.ClickDetector.MouseClick:connect(onClick) 

(PARTSGROUP is the name of the model with the parts inside, change this to the name of the model)

(I made it script.Parent.Parent so the button wont be affected, you can change this if you want, but if you keep it like this, then group the model with the parts in with the button together.)

0
this is my first answer, hopefully ive helped Bylli_Oruze 38 — 4y
0
oh and sorry if i worded anything weirdly, i tried my best to explain what to do Bylli_Oruze 38 — 4y
0
Thank you! It worked well! n00b_warri0r 11 — 4y
0
glad i could help Bylli_Oruze 38 — 4y
Ad

Answer this question