The problem is that your
IF statements are not being closed. You must close them with an
END IF or a
THEN followed by a command of some sort.
According to your need and code above, I would probably setup the code like this:
Sync On
Sync Rate 30
make object cube, 1, 5
REM -------------------
REM ---- MAIN LOOP ----
REM -------------------
do
if Mouseclick() = 1 and pick object(mousex(),mousey(),1,1)>0 then delete object 1
sync
loop
Notice I used
PICK OBJECT instead.
SCREEN OBJECT returns only a single point, whilst pick obect will check the mouse position against all points where the object is on screen..