--activeBullets, rPly, realHitObj, bulletId, fallOff

function BulletServerModule.validateClientBulletHit(activeBullets, rPly, realHitObj, bulletId, fallOff, waitTime)
	if not activeBullets or not rPly or not realHitObj or not bulletId or not fallOff then return end	
	if not string.find(bulletId, tostring(rPly.UserId)) then return end
	
	local bulletObj = activeBullets[bulletId]
	local startTime = tick()
	while not bulletObj and tick() - startTime <= 0.5 do
		bulletObj = activeBullets[bulletId]
		task.wait(waitTime or 0.05)
	end
	if not bulletObj then return end	--This player has above 500 ms most likely, so we can ignore them
	
	local serverDir = (realHitObj.Position - bulletObj.ORIGIN).unit
	if bulletObj.DIRECTION:Dot(serverDir) < 0.5 then return end
	
	return true
end

return BulletServerModule
