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

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

Asked by 9 years ago

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?!!]]

0
Can you put your code in a code block? GoldenPhysics 474 — 9y
0
Whats a code block... User#7446 0 — 9y
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. EzraNehemiah_TF2 3552 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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.

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.. User#7446 0 — 9y
Ad

Answer this question