vector currentPos = llGetPos(); vector relative_pos = (targetPos - currentPos) / 25.0; float max_ground = -1.0; float ground; vector foo = currentPos; integer x; for(x=0;x<=25;++x) { ground = llGround(currentPos + (relative_pos * x)); if(ground > max_ground) { max_ground = ground; } }