Advertisement
lvs

Group for Physics 2

lvs
Nov 21st, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local mt = {}
  2. function mt.__newindex(t, key, value)
  3.     if key == 'X' or key == 'Y' then
  4.         local lkey = key:lower()
  5.         for i = 1, t.numChildren do
  6.             if not t[i][key] then
  7.                 t[i][key] = t[i][lkey]
  8.             end
  9.             t[i][lkey] = t[i][key] + value
  10.         end
  11.     end
  12.     t[key] = value
  13. end
  14. setmetatable(frontgroup, mt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement