Problems:
#1: you have two object with the same number, when you load the cube object 1 is already taken.
#2. When you press the right or left key, its the object that has to rotate not the camera.
#3. In this case, a bit of trigonometry helps! Using Sin/Cos so that the camera moves in a circle around the object. This should work:
sync on
sync rate 60
hide mouse
for x = 1 to 10
make object cube x,100
position object x,rnd(2000),0,rnd(2000)
next x
`edited for testing
`load object "c:\cube.x",1
make object cube 11,10
do
if rightkey()=1
y=wrapvalue(y+1)
`angley#=wrapvalue(angley#+5.0)
endif
if leftkey()=1
y=wrapvalue(y-1)
`angley#=wrapvalue(angley#-5.0)
endif
if upkey()=1
move object 11,10
endif
if downkey()=1
move object 11,-10
endif
`rotate both camera and object
yrotate object 11,y
yrotate camera y
` make the camera to follow the object in a circular manner
position camera object position x(11)-(sin(object angle y(11))*30),object position y(11)+10,object position z(11)-((cos(object angle y(11)))*30)
xrotate camera 2
sync
loop
Hope that helps!
1 + 1 is not 2, is 10
