DarkLink Posted July 24, 2011 Posted July 24, 2011 Guys is there a way to stop looping a table? I mean the table have 10 elements, but I just want to loop the table for the first five, the other five wont get loaded, just ignored. Appreciate some help guys. Thanks. Borderpatrol Project Gamemode - Under Development (80%)
Buffalo Posted July 24, 2011 Posted July 24, 2011 for i=1,10 do if i == 5 then break end end Powered by Kimsufi© ☢ ZHP on Facebook ☢ ZHP on Youtube ☢ Support us ☢
DarkLink Posted July 24, 2011 Author Posted July 24, 2011 thanks for ur reply, but look this: for i,k in ipairs (getElementsByType("vehicle")) do -- how do I do what is here only for the first five cars, when reach the six exit for or do nothing.. end Thanks buffalo. Borderpatrol Project Gamemode - Under Development (80%)
JR10 Posted July 24, 2011 Posted July 24, 2011 for i,k in ipairs (getElementsByType("vehicle")) do if i == 5 then break end end Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
DarkLink Posted July 24, 2011 Author Posted July 24, 2011 for i,k in ipairs (getElementsByType("vehicle")) do if i == 5 then break end end Hmm I see so break is used to leave the for that is inside, right? Thanks. Borderpatrol Project Gamemode - Under Development (80%)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now