That code will work, I tested it and everything myself before putting it on pastebin.

But yes, it won't work in multiple channels since I couldn't get dynamic variables working properly.