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: [BUG] Read-only tables aren't... read-only?

Previous Thread :: Next Thread 
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
13 Nov 2012 11:32 PM
The Instance, Vector3, Vector2, UDim, UDim2, BrickColor, etc tables, in the environment, are read-only. This means you can't edit them, even if you try using rawset.

Really? Nope. I just found out that you can add numerical indices in them by using the table.insert function. And you can probably remove numerical indices from them too using table.remove (though I didn't test that).

Clearly, this is a bug, and it's not supposed to happen. And it's probably not too hard to fix either... then, again, adding read-only tables to the API wasn't exactly a such good idea.
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
13 Nov 2012 11:55 PM
There goes my secret Catalog Heaven update system... >_<
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
14 Nov 2012 12:00 AM
How can that even be used to update a game?
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
14 Nov 2012 12:02 AM
"There goes my secret Catalog Heaven update system... >_<"

You're kidding, right?
Report Abuse
SN0X is not online. SN0X
Joined: 24 Oct 2011
Total Posts: 7277
14 Nov 2012 12:51 AM
@Seranok,

haaaaaaaaaxxxx
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
14 Nov 2012 01:04 AM
Really Seranok? .__.
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
14 Nov 2012 01:56 AM
Does that mean `table.insert` doesn't fire the `__newindex` metamethod?
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
14 Nov 2012 02:02 AM
@NXTBoy

It doesn't. Neither does rawset, but the case of rawset is prevented by read-only tables. However, the case of table.insert is not.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
14 Nov 2012 02:15 AM
For clarification, you cannot make read-only tables. Only ROBLOX can.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
14 Nov 2012 02:17 AM
I'm pretty sure using metatables you can create read-only tables.
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
14 Nov 2012 02:18 AM
@Quenty

You can't.
Report Abuse
TeamDman is not online. TeamDman
Joined: 04 Dec 2009
Total Posts: 897
14 Nov 2012 06:07 AM
But this leaves the question :
How did Seranok use this to update his game?
O_O

§TeamDman§ Anti-Jared
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
14 Nov 2012 06:21 AM
@Quenty: You can use metatables to create somewhat read-only tables, but they will still be able to use rawset and table.insert with them.

@TeamDman: That's what I want to know .-.
Report Abuse
littleAU999 is not online. littleAU999
Joined: 15 Jan 2011
Total Posts: 1375
14 Nov 2012 07:49 AM
l0l ive been spending my whole morning at Script Builder table.inserting stuff into Instance. :P
Report Abuse
SN0X is not online. SN0X
Joined: 24 Oct 2011
Total Posts: 7277
14 Nov 2012 10:35 AM
table.foreach(Instance, print)

??
Report Abuse
littleAU999 is not online. littleAU999
Joined: 15 Jan 2011
Total Posts: 1375
14 Nov 2012 11:03 AM
table.insert(Instance, (function(t) Instance.new('Message', Workspace).Text = t end))

Instance[1]'hi'

o3o
Report Abuse
SN0X is not online. SN0X
Joined: 24 Oct 2011
Total Posts: 7277
14 Nov 2012 02:12 PM
Seranok, HANDS UP FOO!

It's over! We've caught you! (well julien made u catch urself but wtver k)

TELL US HOW U DID IT! *slaps* FOO!
Report Abuse
littleAU999 is not online. littleAU999
Joined: 15 Jan 2011
Total Posts: 1375
14 Nov 2012 02:31 PM
@^, lol'd.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
14 Nov 2012 02:32 PM
Epic..
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
14 Nov 2012 03:19 PM
Here's a question. Since they've removed scripts' shared scopes to stop hijacking, is the Instance and related objects universally used, or are different copies used per script/thread?
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
14 Nov 2012 03:21 PM
um..

    table.insert(table, ["insert"]=function(x) print("lol, you can't insert "..tostring(x or "userdata").." into this table!") end)

:3
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
14 Nov 2012 03:58 PM
@1waffle1

table, string, coroutine and all the other Lua libraries are userdata, not read-only tables. In normal Lua, they're normal tables. However, in ROBLOX, there are also read-only tables, which themselves are not the same thing as normal tables, and which are not used for the Lua libraries, though they are used for the Instance, Vector3, etc tables.
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
14 Nov 2012 04:02 PM
table.insert(Vector3, ["new"]=function(x,y,z) Instance.new("Message", workspace).Text = "lol look at this noob trying to create a vector3 at "..x..", "..y..", "..z.." lol what a noob." end)
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
14 Nov 2012 04:05 PM
@waffle. Now just to inject it in random roblox clients..
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
14 Nov 2012 04:07 PM
table.insert's second argument must be a number.
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