|
| 25 Jun 2012 02:11 PM |
For example
a = game.Workspace.SuperSoldier44.Chest:getChildren() for i = 1, #a do if a[i].className == "Part" then a[i].Transparency = 0.6 end end
and
b = game.Workspace.SuperSoldier44.Arm1:getChildren() for i = 1, #b do if b[i].className == "Part" then b[i].Transparency = 0.6 end end
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 02:14 PM |
a = game.Workspace.SuperSoldier44.Chest:getChildren() b = game.Workspace.SuperSoldier44.Arm1:getChildren() for i = 1, #b do a[#a+1] = b[i] end
for i = 1, #a do if a[i].className == "Part" then a[i].Transparency = 0.6 end end
There may be a table function for this, but I don't have it memorized.
-God Bless- |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 02:19 PM |
If I wanted to set up more, what do I do with the line
for i = 1, #b do a[#a+1] = b[i] end
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 02:24 PM |
I would use pairs and do:
for _, a in pairs(Workspace.SuperSoldier44:GetChildren()) do if a:IsA("Model") then for _, b in pairs(a:GetChildren()) do if b:IsA("BasePart") then b.Transparency = 0.6 end end end end
Basically, that will turn all of the models' inside "SuperSoldier44" part's Transparency to 0.6. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 02:26 PM |
Well, there are a few things you could do. Probably the simplest one is to do the following for each other get children statement:
b = game.Workspace.SuperSoldier44.Arm1:getChildren() for i = 1, #b do a[#a+1] = b[i] end
Just paste that code for each one, changing b to equal the new thing Get Children statement.
-God Bless- |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 02:31 PM |
@LordSymphonic
I would use that script, but then certain parts are affected (Specifically I'm saying my weapon gets holstered, and 1 part named "ShellOut" becomes visable, when it isn't) |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 02:53 PM |
Check this out! I wrote an 'mpairs' function which is just like pairs, except you can give it multiple tables.
function mpairs(...) local x,a,b,t,i = {...},nil,nil,nil,nil; i,t = next(x, t); return function() a,b = next(t, a); while a==nil and b==nil and i~=nil and t~=nil do i,t = next(x, i); if t~=nil then a,b=nil, nil; a,b = next(t, a); end end return a,b; end; end
t = {"Hello", t="World"}; t2 = {[0] = "Hey", [1] = "How", [2] = "Are", [3] = "You?"} for x,y in mpairs(t, t2) do print(x,y); end
Prints: 1 Hello t World 0 Hey 1 How 3 You? 2 Are
|
|
|
| Report Abuse |
|
|