How to acheieve this specific function (maxbullet distance)