sorry my fault, i originally had my lasers in an array and i missed one of the "(i)"s when i was removing them, here is what your code should look like:
load image "lasbeam.png",2000000
make object plain laserobj, 100, 100
make mesh from object 1,laserobj
add limb laserobj, 1, 1
rotate limb laserobj, 1, 90, 0, 0
rotate limb laserobj, 0, 90, 0, 90
texture object laserobj, 2000000
set object cull laserobj, 0
set object transparency laserobj, 1
set object light laserobj, 0
ghost object on laserobj
hide object laserobj
delete mesh 1
global olddistance#=100.0
load object "placer.x",401
position object 401,object position x(300),object position y(300),object position z(300)
yrotate object 401,camera angle y()
move object 401,3
set object collision off 401
do
show sprite 10
if upkey()=1 then print screen fps()
set ambient light 43
rem get object y angle
objectYang#=object angle y(302)
objectXposition#=object position x(302)
objectYposition#=object position y(302)
objectZposition#=object position z(302)
rem get pointed object
pick = pick object(mousex(),mousey(),1,maxobjnum)
set cursor 0,0
if pick > 0
print "On Object: " + str$(pick)
else
print "Not On Object"
PRINT scancode()
endif
print "--------------------"
print object collision(302,0)
print "______________________"
print object position x(401)
print object position y(401)
print object position z(401)
AngleY# = object angle Y(302)
X# = object position X(302)
Y# = GHeight#
Z# = object position Z(302)
Rem Control input for camera
If Upkey()=1 then Move object 302,MoveSpeed#
If Downkey()=1 then Move object 302,(MoveSpeed# * -1.0)
If Leftkey()=1 then Yrotate object 302,Wrapvalue(AngleY#-TurnSpeed#)
If Rightkey()=1 then Yrotate object 302,Wrapvalue(AngleY#+TurnSpeed#)
If object collision(302,0)>0 AND shiftkey()<>1 then position object 302,X#,Y#,Z#
X# = Object position x(302)
Z# = Object position z(302)
Y# = GHeight#
Position object 302,X#,GHeight#,Z#
CameraZ# = Newzvalue(Z#,AngleY#-180,0.2)
CameraX# = Newxvalue(X#,AngleY#-180,0.2)
CameraY# = GHeight#
Position camera CameraX#,CameraY#,CameraZ#
Point camera X#,Y#,Z#
rem An Escape Command
if inkey$()="q" OR inkey$()="Q"
end
endif
rem Create An Object
if inkey$()="c" OR inkey$()="C" then create_object()
rem Save Level1 Setup
if inkey$()="s" OR inkey$()="S" then save("level1.dat")
rem Load Level1 Setup
rem change global ambient light
if inkey$()="8" then inc amlight
if inkey$()="2" then dec amlight
if inkey$()="0"
input "Enter Object Number: ",obje
if object exist(obje)
select_object(obje)
endif
endif
rem selected object
if pick > 0 and mouseclick()=1 then select_object(pick)
rem Sync The Screen
rem place gunBarrel object
position object 401,camera position x(),camera position y(),camera position z()
yrotate object 401,camera angle y()
move object 401,0.95
yrotate object 401,wrapvalue(object angle y(401)+270)
move object 401,0.18
position object 401,object position x(401),object position y(401)-0.25,object position z(401)
rem shoot laser
if spacekey()=1
sx#=object position x(401) : sy#=object position y(401) : sz#=object position z(401)
yrotate object 401,camera angle y()
move object 401,10
hitx#=object position x(401) : hity#=object position y(401) : hitz#=object position z(401)
laserobjx#=(hitx#+sx#)/2
laserobjy#=(hity#+sy#)/2
laserobjz#=(hitz#+sz#)/2
position object laserobj, laserobjx#,laserobjy#,laserobjz#
point object laserobj, hitx#,hity#,hitz#
distance#=sqrt((((sx#-hitx#)^2)+((sy#-hity#)^2))+((sz#-hitz#)^2))
scale object laserobj,2,2,distance#
scale object texture laserobj,1,olddistance#
scale object texture laserobj,1,1/(distance#)
olddistance#=distance#
show object laserobj
endif
sync
loop
thanks for pointing it out i've fixed the original post too
http://www.larinar.tk
AMD athlon 64 3000+, 512mb ddr400, abit kv8, 160gb hdd, gigabit lan, ati radeom 9800se 128mb.