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: are there any metamethods that

Previous Thread :: Next Thread 
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
03 Feb 2016 12:33 PM
Trigger when a value of a table is removed?
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
03 Feb 2016 12:40 PM
No, but you can do the same thing by making a pseudo-table and attaching a metatable to that.

local myTable = {first = true}
local m = {}
m.__index = myTable
m.__newindex = function(t,i,v)

if v == nil then
--property is trying to turn nil
end

setmetatable({},m)
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
03 Feb 2016 12:41 PM
Woops, forgot a few things:

local newTable = setmetatable({},m)

newTable.first = nil
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
03 Feb 2016 12:42 PM
Cool. Ty
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