Take a look at the zzlib repository. It’s a pure Lua implementation. I haven’t ever used it (just found it), so I don’t know if/how it works, but might at least be a good starting point.
You will have to modify it a bit. For instance, in the main zzlib.lua file, it’s trying to dynamically load its core module based on the Lua version. Instead, just grab the inflate-bit32
module, since that’s what we have in Luau.
Also, I can only imagine that deflating in Lua is going to be pretty slow. Just FYI.