Can you check the Sprite → Color Mode, please? This script requires "RGB Color", and might fail to work in other modes.