color penetrate atoms script

Script works fine but does not always color according to time. Is there a way to fix?