generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: onClientEvent problem

Previous Thread :: Next Thread 
TimeTicks is not online. 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
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
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 is not online. 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
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
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 is not online. 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
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
13 Jun 2015 09:36 PM
so you want to see how many frames there are in a frame?

or nah?
Report Abuse
TimeTicks is not online. 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
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image