Adventitiously i made my own script of shootable laser mine which is better. I don't know how old script worked (i just don't want waste time) but in game it visibly worked a bit wrong. But i can explain how my script works: If player have right weapon then do way check: if on this tile laser mine then check if in this zone(i used circle) laser mine then destroy laser mine and stop further counting. This means that now you can destroy any laser mine. Also you can't destroy LM with M3 if distance > 160.
addhook("attack","napad") function napad(id) if player(id,"weapontype")<41 then for i=0,768,4 do local u=math.rad(player(id,"rot")-90); local x,y=player(id,"x")+math.cos(u)*i,player(id,"y")+math.sin(u)*i if tile(math.floor(x/32),math.floor(y/32),"walkable")==true then for _,od in pairs(object(0,"table")) do if object(od,"type")==21 then if object(od,"tilex")==math.floor(x/32) and object(od,"tiley")==math.floor(y/32) then u=math.rad(object(od,"rot")*90-90); local ox,oy=math.floor(x/32)*32+16+math.cos(u)*12,math.floor(y/32)*32+16+math.sin(u)*12 if math.sqrt((ox-x)^2+(oy-y)^2)<8 then if player(id,"weapontype")~=10 or player(id,"weapontype")==10 and math.sqrt((x-player(id,"x"))^2+(y-player(id,"y"))^2)<=160 then parse("killobject "..od); i=768; break end end end end end if i==768 then break end else break end end end end
I used "<41" because i'm also working on ammo for weapons. And some weapons will be changed: P90 -> MP5 G3SG1 -> Galil XM1014 -> M3 Laser -> Five-Seven Flameth -> SG550 UMP45 -> G3SG1 (i'm trying to make similar to hl1 fire rate)