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: What are the practical uses of metatables?

Previous Thread :: Next Thread 
pinballboy7 is not online. pinballboy7
Joined: 12 Mar 2009
Total Posts: 1485
24 Dec 2015 06:48 PM
I've read up on metatables and can't see a single decent use for them, but I've been told they're actually very valuable, so I assume I'm wrong. What would they be used for?
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
24 Dec 2015 06:49 PM
It all depends on what you want to use them for. The major use case is for objects. In Roblox they serve less of a purpose because all of the objects you need are made. If for example, a Vector3 class did not exist, you'd be making it from scratch via metatables.
Report Abuse
nox7 is not online. nox7
Joined: 29 Aug 2008
Total Posts: 27467
24 Dec 2015 06:58 PM
I personally do not agree they are a productive choice for anything you may do in ROBLOX.

The most popular choice is wrappers, but wrappers cause efficiency to go down heavily. Don't use them for high-end production. Just stick to what Lua is meant for. Functions. Quick and fast execution.
Report Abuse
tootoo123456 is not online. tootoo123456
Joined: 23 Apr 2010
Total Posts: 310
24 Dec 2015 07:00 PM
Aren't metatables like no-longer working anymore?
I've read in DingDong272's tutorials correct me if I'm wrong.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Dec 2015 07:30 PM
There are some really cool and clever uses when it comes to metatables on Roblox.
Anyways, behind the scenes metatables are used everywhere. When you call: part:Destroy() for example. Each instance does not have its own Destroy function (that would be a waste of memory) rather, it inherits from Instance. So all derived types from Instances share the same Destroy function. It makes it easier to manage and saves memory.

And then ofc. it goes on and on, pretty much everything you do Roblox-specific uses OOP in some way.
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