Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- table1 = {x=0, y=1, z=0}
- table2 = {x=1, y=1, z=0}
- metatable = {__eq = function(operand1, operand2, type)
- if operand1.x == operand2.x and operand1.y == operand2.y and operand1.z then --Note: In reality you might want to first check if your these variables actually exist
- return true
- else
- return false
- end }
- setmetatable(table1, metatable)
- setmetatable(table2, metatable)
- if table1 == table2 then
- print("Equal")
- else
- print("Not equal")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement