It is more recommended to use workspace:RayCast() because of the 3rd parameter, RaycastParams.
When you cast a ray and it hit’s a player, generate a raycastparams to ignore the player hit and just go 10 studs ahead or in the range that you specified
--First raycast to detect a player
local FirstCast = workspace:RayCast(origin, direction * range) --use a direction vector with range of one to make it flexible
if FirstCast then
local HitPos = FirstCast.Position
local player = --detect if it hit a player or an npc
local params = RaycastParams.new()
params.RaycastFilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = {player.Character}
local secondCast = workspace:RayCast(HitPos, direction * 10, params) --use the same direction from first with new range
if secondCast then
local SecondHitPos = secondCast.Position
---make a blood effect at the second hit position
end
end