PLAYER_CONTROLS:
runspeed#=0.0
if shiftkey()=1 then runspeed#=6.0
if upkey()=1
x#=newxvalue(x#,a#,6+runspeed#)
z#=newzvalue(z#,a#,6+runspeed#)
endif
if downkey()=1
x#=newxvalue(x#,a#,-6-runspeed#)
z#=newzvalue(z#,a#,-6-runspeed#)
endif
if leftkey()=1
x#=newxvalue(x#,wrapvalue(a#-90.0),5.0+runspeed#)
z#=newzvalue(z#,wrapvalue(a#-90.0),5.0+runspeed#)
endif
if rightkey()=1
x#=newxvalue(x#,wrapvalue(a#+90.0),5.0+runspeed#)
z#=newzvalue(z#,wrapvalue(a#+90.0),5.0+runspeed#)
endif
RETURN
CAMERA_STATUS:
rem rotate camera according to mouse
a#=wrapvalue(a#+(mousemovex()/3.0))
rem position and rotate camera
cxa#=cxa#+(mousemovey()/3.0)
if cxa#<-90.0 then cxa#=-90.0
if cxa#>90.0 then cxa#=90.0
position camera x#,get ground height(1,x#,z#)*-1+100,z#
rotate camera wrapvalue(cxa#),a#,0
RETURN
Here ya go. Thanks Phaelax