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: I guess I never thought about it.

Previous Thread :: Next Thread 
Augmentary is not online. Augmentary
Joined: 30 Aug 2013
Total Posts: 8081
21 Apr 2015 01:24 PM
local Table = {}
Table.__index = table

function Table.new()
local t = {}
setmetatable(t, Table)
return t
end

myTable = Table.new()
myTable:insert("value")

Found this on stack overflow, thought it was pretty cool.
Report Abuse
MiniNob is not online. MiniNob
Joined: 14 May 2013
Total Posts: 822
21 Apr 2015 01:29 PM
💩
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
21 Apr 2015 01:29 PM
That won't work on roblox.


I script -~ chimmihc
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
21 Apr 2015 01:30 PM
Never mind, didn't see the Table = {} at the top.


I script -~ chimmihc
Report Abuse
Augmentary is not online. Augmentary
Joined: 30 Aug 2013
Total Posts: 8081
21 Apr 2015 01:36 PM
Table = table

local table = {}
table.__index = Table

function table.new()
local t = {}
setmetatable(t, table)
return t
end

myTable = table.new()
myTable:insert("value")

Table.insert(myTable, "value2")

print(unpack(myTable))
Report Abuse
lucas200206 is not online. lucas200206
Joined: 06 Dec 2009
Total Posts: 899
21 Apr 2015 01:43 PM
You won the life. My congratulations.
Report Abuse
Augmentary is not online. Augmentary
Joined: 30 Aug 2013
Total Posts: 8081
21 Apr 2015 01:44 PM
I know it's not anything crazy I just think it's cool.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
21 Apr 2015 01:48 PM
I used this method to create pseudoplayers so I can do player:save(player.leaderstats)
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
21 Apr 2015 02:09 PM
Lol I found that myself by experimenting a while back, and I asked the impact on performance it would take. Apparently in the long run it can be faster O_O
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
21 Apr 2015 02:10 PM
Faster depending on implementation that is. I forget the exact details.

But I do know : is faster than . so y'know :P
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