thats not why he's getting THAT error.
your error is that when you hit the spacekey then your positioning the object and adding 1 to the object number hundreds of times a second(depending on your fps rate)
see when you press space you are adding one to A then it loops back and does it again and again and again exc...exc....
and your program loops at hundreds of times a second (Depending on your sync settings and fps rate) so do you see how this is a problem? because after 9 loops then the object a doesn't exist.
you need a switch. so when you press space you check if the switch is off. if so. delete the object and add one to your a variable and turn the switch on. if not, do nothing. then check if spacekey isn't being pressed if not? set switch off.
all a switch is, is a variable that you set to 1 or 0(1 being on 0 being off)
You can think of it like a Security alarm. you turn the alarm on and you can't go in. you turn it off and you can. so a example would be like this:
Sync on
Sync rate 0
Do
Set cursor 0,0
Print "Press 1 to turn alarm on."
set cursor 0,20
Print "Press 0 to turn alarm off."
set cursor 0,40
print "Press space to try and go in the house."
If keystate(2)=1 then alarm = 1
If Keystate(11)=1 then alarm = 0
if spacekey()=1
if alarm = 1
Text 0,Screen Height()/2-20,"ALARM WAS SET! THE POLICE WERE CALLED! GET OUT! GET OUT!"
else
Text 0,Screen Height()/2-20,"Alarm Was turned off. You got in Safely!"
endif
endif
sync
cls
loop
Hope that helps!
New Site! Check it out \/