How exactly you use the nearestObject?
In the script executed by the eventHandler or 'in' the eventHandler?
The bullet is way too fast to be succesfully detected in the executed script (extremely sensitive to FPS), it should be 'caught' in the eventHandler, as such:
this addEventHandler ["fired",{(nearestObject [_this select 0, _this select 4]) execVm "thescript.sqf"}]
Now you just refer to the bullet in the script with _this
When cathing the bullet in the eventHandler it's muzzle velocity can be something like 500 000m/s and it still gets caught..