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: Indexing metatables?

Previous Thread :: Next Thread 
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 01:37 PM
so would I do it like this

metatable.table.value


but it doesn't work


Report Abuse
Mitko0o1 is not online. Mitko0o1
Joined: 30 Nov 2010
Total Posts: 5725
20 Sep 2016 01:40 PM
why are you so despearate about these metatables?

just make a dantdm obby
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 01:40 PM
srsly


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
20 Sep 2016 01:43 PM
http://wiki.roblox.com/index.php?title=User:Anaminus/metatables_nutshell#Metatables


Report Abuse
Mitko0o1 is not online. Mitko0o1
Joined: 30 Nov 2010
Total Posts: 5725
20 Sep 2016 01:44 PM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=153801313

check warspy's post
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 01:48 PM
none of that tells me how to index them



none


rip my postcount reset siggy
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
20 Sep 2016 01:58 PM
are you dumb

local mt = getmetatable(table)

mt['hi'] = true

print(mt.hi) >> true


Report Abuse
cntkillme1 is not online. cntkillme1
Joined: 16 Feb 2012
Total Posts: 592
20 Sep 2016 02:15 PM
ffs we told you think already
a metatable IS A TABLE
you index a metatble just like you index a table because a metatable IS A TABLE
when you attach a metatable to a table the metatable IS STILL A TABLE
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 03:12 PM
dude #### about ########## already kid they are normal tables THEY DONT DO ANYTHING DIFFERENTLY EXCEPT GIVE YOUR NEW TABLE CREATED WITH THAT ######### SOME SPECIAL PROPERTIES
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 03:13 PM
OMFG BUT I DON'T HAVE THE TABLE WITH GETMETATABLE THAT'S WHAT IM TRYING TO INDEX


im vegan
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 03:16 PM
kid

1) your metatable is a table containing the special methods and functions of the main table
2) setmetatable returns a table that uses that metatable
3) metatables are tables
4) metatables do not have the created tables, it just holds what they share
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 03:17 PM
Why isn't

metable.table



WORKING


you said it would

don't deny it


im vegan
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 03:17 PM
stop using metatables for absolutely no reason you wombat
only use them if you want to create a special or certain value type or handler for a specific 'object' or item
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 03:18 PM
"metatables do not have the created tables, it just holds what they share"
"why isnt metatable.table WORKING"
because you are a complete idiot who knows nothing about metatables
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 03:18 PM
im using oop


im vegan
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 03:19 PM
DUDE WHY CAN'T YOU JUST HELP ME METATABLES SUCK

WHATS THE POINT IN THEM OMG CAN U EXPLAIN


im vegan
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 03:20 PM
you are the worst at explaining things ever srsly


im vegan
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 03:21 PM
"It just holds what they share"

so metatable.Position?


WHAT? I need one position not 7 positions and this won't work


im vegan
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 03:24 PM
no the ONLY reason you should be using ########## is if you want a table to NOT ACT LIKE A NORMAL TABLE print(CFrame.new()*CFrame.new()) what does this do? it makes them both combine! BECAUSE THEY ARE TABLES ########## form) WITH ########## ################################# ### ### ## ##### if you really think you need ########## if you want to make OOP you can do it just fine without them local test = {} function test.new(val) return setmetatable({noob = val^2},test) end function test:__tostring() return "noob is " .. self.noob end function ############# return test.new(self.noob^0.5 + b.noob^0.5) end print(test.new(2)) print(test.new(8)*test.new(4)) --print(test.new(2)+test.new(1)) errors because no addition method was created ############################### ########### containing index
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 03:25 PM
http://
pastebin.
com/
vUufYYdg
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 03:27 PM
*print(getmetatable(test.new(0)))
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
20 Sep 2016 03:27 PM
the real use for metatables is making api
which i highly doubt what you're doing calls for
you're overcomplicating it

how about this, use some grammar, fully explain what you're trying to do, maybe include so reference code, explain what it is doing, and what you want it to do
step by step helps a lot

you're giving us pretty much nothing relevant to work with, if you couldn't tell, your questions have been answered but the answers for you don't help
guess what? you're asking the wrong questions
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 03:29 PM
DUDE IM USING OOP


im vegan
Report Abuse
Afro_Sub is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
20 Sep 2016 03:30 PM
I CANT EXPLAIN IT ANYMORE IM TIRED


im vegan
Report Abuse
Wunder_Wulfe is not online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
20 Sep 2016 03:30 PM
^ "DUDE IM USING OOP"

do you even know what OOP is

and you dont have to use metatables you mentally ill child

local newObject = {
position = "cool";
}

print(newObject.position)
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