|
| 31 Jan 2012 07:48 AM |
I really have no idea how this is supposed to work.
local c = script.Parent:GetChildren()
while true do for i=1,#c do if (c[i].className == "Part") then c[i].Transparency = 0 c[i].CanCollide = true wait(2) c[i].Reflectance = 0.4 wait(0.2) c[i].Reflectance = 0 wait(0.8) c[i].Reflectance = 0.4 wait(0.2) c[i].Reflectance = 0 wait(0.8) c[i].Reflectance = 0.4 wait(0.2) c[i].Reflectance = 0 wait(0.8) c[i].Transparency = 1 c[i].CanCollide = false wait(5) end end end
But anyway, I want all in the model to go through the loop simultaneously, which isn't happening. |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 31 Jan 2012 08:41 AM |
for index,block in pairs(script.Parent:GetChildren()) do if block.className == "Part" then block.Transparency = 0 block.CanCollide = true wait(2) for i = 1,3 do block.Reflectance = 0.4 wait(0.2) block.Reflectance = 0 wait(0.8) end block.Transparency = 1 block.CanCollide = false end end
Wait, you want them to all go through at the same time? In that case.
Put this code in a script in workspace.
for index,block in pairs(script.Parent:GetChildren()) do if block.className == "Part" then code = game.Lighting.Changer:clone() code.Parent = block end end
Put this code in a script called 'Changer' in Lighting.
block.Transparency = 0 block.CanCollide = true wait(2) for i = 1,3 do block.Reflectance = 0.4 wait(0.2) block.Reflectance = 0 wait(0.8) end block.Transparency = 1 block.CanCollide = false |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2012 10:02 AM |
A bit of clarification: -The blocks are in the same model as the script -I want to use one script only -The script needs to work for every block, no matter how many there are in the model |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 31 Jan 2012 10:18 AM |
My method work's for every part in the model. Sorry, I made a error.
for index,block in pairs(script.Parent:GetChildren()) do if block.className == "Part" then code = game.Lighting.Changer:clone() code.Parent = block end end
That script goes in a script in the model, but you'll need a script in lighting to clone into every brick. That's the only way I know of to get them all to run at once, unless you want to use coroutines. |
|
|
| Report Abuse |
|
|