This is a tricky one because currently Apple themselves only offer OS X back as far as Yosemite, but perhaps the GibMacOS script can go back even further?
Yes, if you run the *.pkg file on a modern Mac it will tell you that you can't expand/install it. You need to be running a version of macOS immediately prior or of the same release to the one you are trying to install. So ...
You need to go the long way round by creating an installer
manually as
@trs96 explained. Once you have done
that then you will have to start the installation on a PC which has had its internal date set to the same - or very shortly after - the date that the OS X version was released, or it will fail again.
This is one of the biggest obstacles to installing such an old version of OS X on modern hardware. I know, I've been there. One tip is to ensure you have no Internet access live for the installer, or it will see the real date and update. Sometimes you even have to change the motherboard BIOS date too. Another thing to get your head around, is "spoofing" of a necessary, and contemporary, CPU, or again installation will fail. The GPU issue has already been covered above.