Your code works here (with trivial changes so I can see something). But there is a potential problem - the scale values should probably be floats not integers.
Here's the code I used:
set display mode desktop width(), desktop height(), 32
sync on
autocam off
position camera -200, 100, -200
point camera 0, 25, 0
choose = 0
repeat
center text screen width()/2,0,"1 = new terrain, 2 = load terrain, 9 = exit"
if keystate(2)
input "insert heightmap name: ",heightmap$
input "insert terrain scale x: ",scalex
input "insert terrain scale y: ",scaley
input "insert terrain scale z: ",scalez
input "set number of tiles per side: ",tilenumber
input "insert terrain texture name: ",textureimage$
if file exist(heightmap$)
if terrain exist(1) = 0
make object terrain 1
set terrain heightmap 1,heightmap$
endif
else
text 0,10,"heightmap doesn't exist!, press any key to exit..."
sync
wait key
end
endif
if file exist(textureimage$)
if image exist(1) = 0
load image textureimage$,1,1
set terrain scale 1,scalex,scaley,scalez
set terrain split 1,tilenumber
set terrain texture 1,1,1
set terrain tiling 1, 1
set terrain light 1, 1, -0.25, 0, 1, 1, 0.78, 0.5
build terrain 1
choose = 1
endif
else
text 0,10,"texture doesn't exist!, press any key to exit..."
sync
wait key
end
endif
endif
sync
until choose = 1
movetimer = timer()
do
set cursor 0,100
print "FPS: " + str$(screen fps())
if timer() >= movetimer + 50
` freemove20fps(mousemovex(),mousemovey())
movetimer = timer()
endif
sync
loop
Perhaps the problem is in the bit you didn't give us?