I get this Script Error when freezing somebody..
Seems the function he uses exists in ULib only.
Likely, when placing in autorun, it's loading before ULib does.
Try this .. take your ulxphysgun.lua file you created from the code above and move it to <gmod server>/addons/ulx/lua/ulx/modules/
No guarantee, but that will increase your chances of it working.