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 » Scripting Helpers
Home Search
 

Re: How to improve this?

Previous Thread :: Next Thread 
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 06:25 PM
tab = {"I", "Hate", "you"}

function reorganize(tab)
for index, val in pairs(tab) do
table.remove(tab, index)
end
repeat wait(0.1) until #tab == 1
table.remove(tab, 1)
end
reorganize(tab)
print(#tab)
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
18 Sep 2013 06:27 PM
tab = {"I", "Hate", "you"}

function reorganize(t)
for index, val in pairs(t) do
val = nil
end
end
reorganize(tab)
print(#tab)
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
18 Sep 2013 06:32 PM
Zach yours doesn't work like at all.
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
18 Sep 2013 06:35 PM
I'm guessing you're trying to remove all of the table values?

If so then, yes, you're right. I made a mistake.

tab = {"I", "Hate", "you"}

function reorganize(t)
for index, val in pairs(t) do
t[index] = nil
end
end
reorganize(tab)
print(#tab)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Sep 2013 06:36 PM
Fastest way:
tab = {}
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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