Optimized kill.lua and killpkred.lua