Advertisement
lvs

Group for Physics

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