KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 07 Jul 2014 02:28 PM |
Is it possible to have a for loop within another where I can use each of the array arguments? Example: p={} d={} for i,v in pairs (p) do for e,z in pairs (d) do end end |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
| |
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 07 Jul 2014 02:34 PM |
So this would work?
for i,v in pairs (game.Workspace:GetChildren()) do for e,z in pairs (v:GetChildren()) do if v.Name == "Car" and v.VehicleSeat.SeatWeld.Part1.Parent == character then v.z.SpotLight.Enabled = true end end end |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
|
| 07 Jul 2014 02:34 PM |
| As long as the objects exist in the proper place, yes. |
|
|
| Report Abuse |
|
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 07 Jul 2014 02:42 PM |
Mouse.KeyDown:connect(function(Key) if Key:lower() == "l" then for i,v in pairs (game.Workspace:GetChildren()) do for e,z in pairs (v:GetChildren()) do if v.Name == "Car" and v.VehicleSeat.SeatWeld.Part1.Parent == character then if z.Name == "Light" then v.z.SpotLight.Enabled = true end end end end end end) z is not a valid of model why is that? |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
| |
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 07 Jul 2014 02:47 PM |
It worked perfectly. With ever high gratitude.
KO~Out. |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
| |
|