TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Jun 2015 09:22 PM |
local re = game.ReplicatedStorage.MatchSet
re.OnClientEvent:connect(function(plr) local player = game.Players.LocalPlayer local plrs = game.Players:GetChildren() local cells = script.Parent.Cells local cchild = cells:GetChildren()
for i = 1,#plrs do print(i) for n = 1,#cchild do print(n) --why won't it print this? end end end)
Output: > 1
Why won't it loop through cchild? It only print i not n.. :/ |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 09:25 PM |
why not use in pairs(or next because Abstract is watching people)
where is this Local Script? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Jun 2015 09:27 PM |
this local script is located in a frame.
I am not using pairs in this specific situation because I don't want it to loop through 10 times just to get 1 thing. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 09:29 PM |
for n = 1,#cchild do
is the same as
in pairs
it loops through the whole table/model, except for n = 1,#cchild doesn't return the object, unlike in pairs
what are you trying to find? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Jun 2015 09:34 PM |
I am trying to find another frame located in the Cells Frame.
If there are no frames then I just want to
print("n equals 0")
|
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 09:36 PM |
so you want to see how many frames there are in a frame?
or nah? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Jun 2015 09:38 PM |
| Yes I want to check how many frames are in the Cells frame. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 09:39 PM |
If all children are frames then
#script.Parent.Cells:GetChildren()
if not then
local number = 0 for i,v in pairs(script.Parent.Cells:GetChildren()) do if v:IsA("Frame") then number = number + 1 end end |
|
|
| Report Abuse |
|
|