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
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Script keeps skipping for i,v in pairs (Blah) do

Previous Thread :: Next Thread 
Bwc904 is not online. Bwc904
Joined: 16 Nov 2011
Total Posts: 184
20 Sep 2016 04:33 PM
Hey! I'm working on a script in which I do a getchildren() and then at that to another table, but the script just keeps skipping all my in pairs. Anyone know to fix it?

Here's a bit of my script.

function Tables()
print "yolo"
for i,v in pairs(InvC) do
print"Doing"
table.insert(InvT, v)
print("First Table"..v)
end
end
Tables()

--
it prints Yolo, but nothing else.
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
20 Sep 2016 04:37 PM
maybe InvC is an empty table?
Report Abuse
Bwc904 is not online. Bwc904
Joined: 16 Nov 2011
Total Posts: 184
20 Sep 2016 04:38 PM
No because it's not even printing "Doing" :/
Report Abuse
Bwc904 is not online. Bwc904
Joined: 16 Nov 2011
Total Posts: 184
20 Sep 2016 04:38 PM
Well Yea, it MIGht be empty, would that make it not run?
Report Abuse
igunaa is not online. igunaa
Joined: 15 Sep 2010
Total Posts: 2588
20 Sep 2016 04:40 PM
If it has nothing to run over, it won`t.

Said the wise.
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 04:41 PM
well yes because there is nothing to iterate :/

local iteration = 0
local iterfunc = function()
return (iteration<10 and iteration) or nil
end

for i in iterfunc do
print(i)
end
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 04:42 PM
oops i meant this


local iteration = 0
local iterfunc = function()
iteration = iteration + 1
return (iteration<10 and iteration) or nil
end

for i in iterfunc do
print(i)
end

--an intro into interating functions
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
20 Sep 2016 04:44 PM
print #InvC to check
Report Abuse
Bwc904 is not online. Bwc904
Joined: 16 Nov 2011
Total Posts: 184
20 Sep 2016 04:46 PM
Thanks yall, It was doing to getchildren() before my other script even made the children so there was nothin in the table. ;)
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