Raycasting Problems

Server side:

game.ReplicatedStorage.FireEvent.OnServerEvent:Connect(function(plr,pos,origPos,dmg)
print('d')
	local e = RaycastParams.new()
	e.FilterDescendantsInstances = {plr.Character}
	e.FilterType = Enum.RaycastFilterType.Blacklist
	e.IgnoreWater = false
	local rayDirection = origPos - pos
	local raycastResult = workspace:Raycast(origPos, rayDirection, e)

	if raycastResult then
print('e')
		local hitPart = raycastResult.Instance

		local hitParent = hitPart:FindFirstAncestorOfClass('Model')

		local hum = hitParent:FindFirstChild('Humanoid')
		hum.Health = hum.Health - dmg
	
	end
end)

Client side:

script.Parent.Activated:Connect(function()
script.Parent.FiredSound:Play()
print('a')
game.ReplicatedStorage.FireEvent:FireServer(game.Players.LocalPlayer:GetMouse().Hit.p,game.Players.LocalPlayer.Character.RightHand.Position, script.Parent.Config.Damage.Value)
end)

Problem:
The script usually only prints to d, meaning it isn’t raycasting.

You did not give it a value on how long it will go.
It is probably because you are aiming at the sky and not aiming at a part which would not get a result or the part is too far.

You did not give it a value on how long it will go on the direction

Local direction = origPos - Pos * - how long you want it

You should output some variables - like making sure your direction is correct. You’re going in blind without double checking your data.

However, there is also the possibility the direction vector isn’t long enough. The point the mouse hits may be on the surface and not actually intersecting the part. Add a few more studs to the distance in that direction.

origin - pos

Is the direction + magnitude to the location but it may not be long enough to actually intersect.

Ok, I added that
local rayDirection = origPos - pos * 300

local hitParent = hitPart:FindFirstAncestorOfClass('Model')

print('f')

print(hitParent.Name)

local hum = hitParent:FindFirstChild('Humanoid')

if hum then
		local dmgUI = game.ReplicatedStorage.DMG_UI:Clone()
		dmgUI.Parent = hitParent:FindFirstChild('Head')
		dmgUI.dmg.Text = '<b>-'..dmg..'</b>'
		hum.Health = hum.Health - dmg
end
end

Very rarely damages the zombie.