Where....did he get those guns in one of the most restrictive gun countries in the world?
Where did you get this totally erroneous idea?
New Zealand has the most permissive gun laws in the region.
It and the USA are the only two developed countries to not have universal gun registration. Semi automatic weapons are permitted in NZ.
There is likely a reason that an Australian terrorist traveled to NZ to carry out an attack using weaponry that is banned and in practice unobtainable in Australia, but relatively common over there.