whenever i try to run my code it says could not understand command at line______ . A. there is no code on the line stated B. i tryed deleting the line but it just kept going up. my code is posted beleow
global charposx as integer
global charposy as integer
global charposz as integer
global camup as integer
global sidecam as integer
global res2 as integer
global res3 as integer
global res4 as integer
global res5 as integer
global res6 as integer
global res7 as integer
global res8 as integer
global res9 as integer
global res10 as integer
global rat2x as integer
global rat2z as integer
global rat3x as integer
global rat3z as integer
global rat4x as integer
global rat4z as integer
global rat5x as integer
global rat5z as integer
global rat6x as integer
global rat6z as integer
global rat7x as integer
global rat7z as integer
global rat8x as integer
global rat8z as integer
global rat9x as integer
global rat9z as integer
global rat10x as integer
global rat10z as integer
camup=60
make object cube 1,30
do
char_pos()
camera_stuff()
move_char()
respawn_rat()
kill_rat()
loop
function kill_rat()
object exist(2)=1 then rat2x= object position x(2)
object exist(2)=1 then rat2z= object position z(2)
if spacekey()=1 and object exist(2)=1 and abs(charposx-rat2x)<=25 and abs(charposz-rat2z)<=25
delete object 2
endif
object exist(3)=1 then rat3x=object position x(3)
object exist(3)=1 then rat3z=object position z(3)
if spacekey()=1 and object exist(3)=1 and abs(charposx-rat3x)<=25 and abs(charposz-rat3z)<=25
delete object 3
endif
object exist(4)=1 then rat4x=object position x(4)
object exist(4)=1 then rat4z=object position z(4)
if spacekey()=1 and object exist(4)=1 and abs(charposx-rat4x)<=25 and abs(charposz-rat4z)<=25
delete object 4
endif
object exist(5)=1 then rat5x=object position x(5)
object exist(5)=1 then rat5z=object position z(5)
if spacekey()=1 and object exist(5)=1 and abs(charposx-rat5x)<=25 and abs(charposz-rat5z)<=25
delete object 5
endif
object exist(6)=1 then rat6x=object position x(6)
object exist(6)=1 then rat6z=object position z(6)
if spacekey()=1 and object exist(6)=1 and abs(charposx-rat6x)<=25 and abs(charposz-rat6z)<=25
delete object 6
endif
object exist(7)=1 then rat7x=object position x(7)
object exist(7)=1 then rat7z=object position z(7)
if spacekey()=1 and object exist(7)=1 and abs(charposx-rat7x)<=25 and abs(charposz-rat7z)<=25
delete object 7
endif
object exist(8)=1 then rat8x=object position x(8)
object exist(8)=1 then rat8z=object position z(8)
if spacekey()=1 and object exist(8)=1 and abs(charposx-rat8x)<=25 and abs(charposz-rat8z)<=25
delete object 8
endif
object exist(9)=1 then rat9x=object position x(9)
object exist(9)=1 then rat9z=object position z(9)
if spacekey()=1 and object exist(9)=1 and abs(charposx-rat9x)<=25 and abs(charposz-rat9z)<=25
delete object 9
endif
object exist(10)=1 then rat10x=object position x(10)
object exist(10)=1 then rat10z=object position z(10)
if spacekey()=1 and object exist(10)=1 and abs(charposx-rat10x)<=25 and abs(charposz-rat10z)<=25
delete object 10
endif
endfunction
function move_char()
if keystate(17)=1 then move object 1,.5
if keystate(31)=1 then move object 1,-.5
if keystate(30)=1 then turn object left 1,1
if keystate(32)=1 then turn object right 1,1
endfunction
function camera_stuff()
position camera charposx+sidecam,charposy+camup,charposz-70
point camera charposx,charposy,charposz
if upkey()=1 and camup<100 then inc camup,1
if downkey()=1 and camup>0 then dec camup,1
if rightkey()=1 and sidecam<150 then inc sidecam,1
if leftkey()=1 and sidecam>-150 then dec sidecam,1
endfunction
function respawn_rat()
if object exist(2)=0
inc res2,1
endif
if object exist(2)=0 and res2>=10
make object sphere 2,25
position object 2,rnd(250),0,rnd(250)
res2=0
endif
if object exist(3)=0
inc res3,1
endif
if object exist(3)=0 and res3>=10
make object sphere 3,25
position object 3,rnd(250),0,rnd(250)
res3=0
endif
if object exist(4)=0
inc res4,1
endif
if object exist(4)=0 and res4>=10
make object sphere 4,25
position object 4,rnd(250),0,rnd(250)
res4#=0
endif
if object exist(5)=0
inc res5,1
endif
if object exist(5)=0 and res5>=10
make object sphere 5,25
position object 5,rnd(250),0,rnd(250)
res5=0
endif
if object exist(6)=0
inc res6,1
endif
if object exist(6)=0 and res6>=10
make object sphere 6,25
position object 6,rnd(250),0,rnd(250)
res6=0
endif
if object exist(7)=0
inc res7,1
endif
if object exist(7)=0 and res7>=10
make object sphere 7,25
position object 7,rnd(250),0,rnd(250)
res7=0
endif
if object exist(8)=0
inc res8,1
endif
if object exist(8)=0 and res8>=10
make object sphere 8,25
position object 8,rnd(250),0,rnd(250)
res8=0
endif
if object exist(9)=0
inc res9,1
endif
if object exist(9)=0 and res9>=10
make object sphere 9,25
position object 9,rnd(250),0,rnd(250)
res9=0
endif
if object exist(10)=0
inc res10,1
endif
if object exist(10)=0 and res10>=10
make object sphere 10,25
position object 10,rnd(250),0,rnd(250)
res10=0
endif
endfunction
function char_pos()
charposx=object position x(1)
charposy=object position y(1)
charposz=object position z(1)
endfunction
i looked over it a hundred times but i caant find a problem. could someone plz look over my code for me. also if you have any suggestions to shorten my code i would be very grateful