You should use an array to store all the different positions of each spiders.
Put your FOR*NEXT loop inside the DO*LOOP. And "SpiderNum = 1 + SpiderNum" is not needed because the FOR*NEXT loop already inc SpiderNum every iteration.
Move the sync along with the LOOP statement, you sync right before you loop.
Hear are the changes to the code.
`set screen to manual update
sync on
sync rate 80
hide mouse
REM Changes X,Y,VelX,VelY into arrays
global dim SpiderX(999) as integer
global dim SpiderY(999) as integer
global dim VelX(999) as integer
global dim VelY(999) as integer
global Frame as integer = 1
global SpiderNum as integer
`set transparent color to pink
set image colorkey 255, 0, 255
`make spider sprite
create animated sprite 1, "redspiderwalking.bmp", 8, 8, 1
`clone spider sprite
for SpiderNum = 1 to 999
clone sprite 1, 1 + SpiderNum
next SpiderNum
`make sure all drawing now goes to the screen
set current bitmap 0
`Preset all the spiders data
for SpiderNum = 1 to 999
SpiderY(SpiderNum) = rnd(640)
SpiderY(SpiderNum) = rnd(480)
VelX(SpiderNum) = rnd(4) + 1
VelY(SpiderNum) = rnd(4) + 1
next SpiderNum
do
for SpiderNum = 1 to 999
SpiderY(SpiderNum) = SpiderY(SpiderNum) + VelY(SpiderNum)
if SpiderY(SpiderNum) < 1
VelY(SpiderNum) = VelY(SpiderNum) * -1
endif
if SpiderY(SpiderNum) > screen height() - 64
VelY(SpiderNum) = VelY(SpiderNum) * -1
endif
SpiderX(SpiderNum) = SpiderX(SpiderNum) + VelX(SpiderNum)
if SpiderX(SpiderNum) < 1
VelX(SpiderNum) = VelX(SpiderNum) * -1
endif
if SpiderX(SpiderNum) > screen width() - 64
VelX(SpiderNum) = VelX(SpiderNum) * -1
endif
`update the sprite frame each time thru the game loop
play sprite SpiderNum, 1, 7, 40
`draw the current sprite frame at X,Y
sprite SpiderNum, SpiderX(SpiderNum), SpiderY(SpiderNum), 1
next SpiderNum
`refresh the screen
sync
loop