Something like this:
sync on : sync rate 0
REM MAKE MATRIX
MAKE MATRIX 1,1000,1000,10,10
REM MAKEOBJECT BOX(SWORD)
MAKE OBJECT BOX 1,5,20,1
ZROTATE OBJECT 1,30
XROTATE OBJECT 1,20
REM POSITION CAMERA
PITCH CAMERA UP 10
POSITION CAMERA 0,50,0
REM LOOP
DO
mx=mx+mousemovex() : my=my+mousemovey()
if mx<9 then mx=9
if my<37 then my=37
if mx>72 then mx=72
if my>85 then my=85
REM CONTROL OBJECT(SWORD)
LOCK OBJECT ON 1
POSITION OBJECT 1,MX-40,-MY+60,40
REM CONTROL CAMERA
IF UPKEY ()=1 THEN MOVE CAMERA 0.7
IF DOWNKEY ()=1 THEN MOVE CAMERA -0.5
IF LEFTKEY()=1 THEN TURN CAMERA LEFT 0.4
IF RIGHTKEY ()=1 THEN TURN CAMERA right 0.4
IF CONTROLKEY ()=1 AND UPKEY ()=1 THEN MOVE CAMERA 1.3
text 0,0,"MX:"+str$(mx)+", MY:"+str$(my)
sync
LOOP
Note that I added sync controls, and changed the mouse handling so it's all in variables which are changed according to the mouse movements rather than position. Also the mouse is limited to keep the weapon in screen, you can experiment with the values quite easily as it displays them as well - you'd just rem out the checks at the start of the code to work out your own limits.
Van-B

It's c**p being the only coder in the village.