I'm ceating Weapon Studio(a free weapon creator for FPSC). Everything works fine except the HUD Postioner. In the HUD Postioner its supposed to move the the model around with keys thats it. But when its running in at random times it completely freezes(the program not my computer.)
Here is the code:
x=3
y=3
z=3
xr=3
yr=3
zr=3
open to read 2,"rotatex.wsc"
open to read 3,"rotatey.wsc"
open to read 4,"rotatez.wsc"
read string 2,x$
read string 3,y$
read string 4,z$
linezr=1
lineyr=1
linexr=1
load image "Files/gamecore/guns/MyNewGuns/"+modelfinal$+"/"+tx$+txe$,1
rem HUD Postioner---------------------------------------------------------
DO
sync on:sync rate 30
load object "Files/gamecore/guns/MyNewGuns/"+modelfinal$+"/"+"HUD.x",1
position object 1,x,y,z
texture object 1,1
xrotate object 1,xr
yrotate object 1,yr
zrotate object 1,zr
if SCANCODE()=13
y=y+3
endif
if SCANCODE()=12
y=y-3
endif
if RIGHTKEY()=1
x=x+1
endif
if LEFTKEY()=1
x=x-3
endif
if UPKEY()=1
z=z+3
endif
if DOWNKEY()=1
z=z-3
endif
if SCANCODE()=17
if zr=360
zr=3
close file 4
open to read 4,"rotatez.wsc"
read string 4,z$
linezr=1
endif
zr=zr+3
read string 4,z$
linezr=linezr+1
endif
if SCANCODE()=31
if zr=3
zr=360
blinezr=0
close file 4
open to read 4,"rotatez.wsc"
REPEAT
read string 4,z$
blinezr=blinezr+1
UNTIL blinezr=360
endif
zr=zr-3
close file 4
blinezr=1
open to read 4,"rotatez.wsc"
REPEAT
read string 4,zr$
blinezr=blinezr+1
UNTIL blinezr=linezr-1
endif
if SCANCODE()=32
if xr=360
xr=3
close file 2
open to read 2,"rotatex.wsc"
read string 2,x$
linexr=1
endif
xr=xr+3
read string 2,x$
linexr=linexr+1
endif
if SCANCODE()=30
if xr=3
xr=360
blinexr=0
close file 2
open to read 2,"rotatex.wsc"
REPEAT
read string 2,x$
blinexr=blinexr+1
UNTIL blinexr=360
endif
xr=xr-3
close file 2
blinexr=1
open to read 2,"rotatex.wsc"
REPEAT
read string 2,xr$
blinexr=blinexr+1
UNTIL blinexr=linexr-1
endif
if SCANCODE()=2
if yr=360
yr=3
close file 3
open to read 3,"rotatey.wsc"
read string 3,y$
lineyr=1
endif
yr=yr+3
read string 3,y$
lineyr=lineyr+1
endif
if SCANCODE()=3
if yr=3
yr=360
blineyr=0
close file 3
open to read 3,"rotatey.wsc"
REPEAT
read string 3,y$
blineyr=blineyr+1
UNTIL blineyr=360
endif
yr=yr-3
close file 3
blineyr=1
open to read 3,"rotatey.wsc"
REPEAT
read string 3,yr$
blineyr=blineyr+1
UNTIL blineyr=lineyr-1
endif
sync
LOOP
All the .wsc files have all the multiples of 3 all the way to 360.