quote:
Originally posted by phalanxii
code:
"Delay1"+ChatWnds.length-1
This is not a valid string. "Delay1" is a string and ChatWnds.length is a number, so the plus operator (+) joins them together as a new string object. The -1 is supposed to subtract 1 from a number object, but as "Delay1"+ChatWnds.length is a string, the result is you get a messed up timer ID.
Your original script was correct in putting brackets there:
code:
"Delay1"+[ChatWnds.length-1]
This way, the number is calculated first, then appended to "Delay1". The reason why it probably didn't work was because of the end parentheses for the first if statement.
no... if you want to make sure it is calculated first use:
code:
"Delay1"+(ChatWnds.length-1)
but even without it probably works correctly...