Help puting background process ID's into an array

I am trying to write a script that runs another script consecutively and records the PID of the called script each time it runs in an array.
I put in an echo statement to check the PID, when the script runs no PID is output, and the array seems to be empty. I assume it is problem with my code, but kind of stuck as to where.

i=0

while [ $i -lt 5 ]
   do
        ./script
        array[$i]=$!
       echo $! #there to test that the PID exists
       let i=i+1
   done

any takers?

The syntax looks fine. But if you don't run ./script in the background it will have finished before you try to capture the pid.

ie.

/root # sleep 1
/root # echo $!
 
/root # sleep 10 &
[1]     2971
/root # echo $!
2971

I was missing the "&", that made it work. Thanks!