it's broke

Script works as intended in SP, doubtless needs innumerable changes to work MP, which I know nothing about.