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

Can you select children of a parent and make it so the children gets + .2 transparency?

hits = script.Parent.hit local newtree = script.Parent:clone()

while true do --infinite loop if hits.Value < 1 then script.Parent:BreakJoints() wait(1) --wait a while script.Parent.Parent.Logz.Anchored = false script.Parent.Parent.Logz.Transparency = 0 script.Parent.Parent.Logz.CanCollide = true script.Parent:remove() wait(10) --wait a while newtree.Parent = game.Workspace newtree:MakeJoints() end wait(1) end

if hits.Value -1 then script.Parent.

end

--[[ I left off on script.Parent when I wasn't sure how to do this I am wondering how to make it so it gets the parents Children and makes the parents children +.2 transparency.... Help?!!]]

3 comments

0

Can you put your code in a code block?

0

Whats a code block...

1

When you ask a question, there is a picture of the Lua logo. Click that and a bunch of squiggly lines appear. You insert the script in BETWEEN those lines.

1 answer

Use :GetChildren and IsA

Example:

local child = workspace:GetChildren()
for i = 1, #child do
if (child[i]:IsA("BasePart")) then
child[i].Transparency = child[i].Transparency+.2
end 
end

This would get everything in workspace and change the transparency. Now, the players never get transparent because they are not directly a basepart. They are a model.

1 comment

0

I was looking for like if a value gets hit by a part it gets minused 1 then when it gets minused one the parts in the group will have more and more transparency... Idk..

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