Advertisement
merlin11188

Track Table Access

Jun 23rd, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. --This script is designed to track all table access
  2.  
  3. TableYouWantHere={23, 13, 15} -- That's the only thing you have to edit.
  4. local x=TableYouWantHere
  5. local TableYouWantHere={}
  6. setmetatable(TableYouWantHere, {
  7.     __index=function(Table, Key)
  8.         --Stuff
  9.         print("Indexed table")
  10.         return x[Key]
  11.     end,
  12.     __newindex=function(Table, Key, Value)
  13.         --stuff
  14.         print("Created new index")
  15.         x[Key]=Value
  16.     end
  17. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement