local J={}function J.Shoot(J,H,Q,m,D)local n=RaycastParams.new()n.FilterDescendantsInstances={J.Character}n.FilterType=Enum.RaycastFilterType.Blacklist local Z=workspace:Raycast(H,(Q-H)*D,n)if Z then local J=Z.Instance local H=J:FindFirstAncestorOfClass("\077\111\100\101\108")if H then if H:FindFirstChild("\072\117\109\097\110\111\105\100")then H.Humanoid.Health-=m end end end end function J.RayCast(J,H,Q,m,D)local n=RaycastParams.new()n.FilterDescendantsInstances=D n.FilterType=Enum.RaycastFilterType.Blacklist local Z=workspace:Raycast(J,(H-J)*m,n)if Z then return Z end end return J
local Combat = {}

function Combat.Shoot(player, origin, mousePos, damage, distance)
	local RayCastParams = RaycastParams.new()
	RayCastParams.FilterDescendantsInstances = {player.Character}
	RayCastParams.FilterType = Enum.RaycastFilterType.Blacklist

	local RayCastResults = workspace:Raycast(origin, (mousePos - origin) * distance, RayCastParams)

	if RayCastResults then
		local HitPart = RayCastResults.Instance
		local Model = HitPart:FindFirstAncestorOfClass("Model")

		if Model then
			if Model:FindFirstChild("Humanoid") then
				Model.Humanoid.Health -= damage
			end
		end
	end
end

function Combat.RayCast(origin, destination, damage, distance ,blacklist)
	local RayCastParams = RaycastParams.new()
	RayCastParams.FilterDescendantsInstances = blacklist
	RayCastParams.FilterType = Enum.RaycastFilterType.Blacklist

	local RayCastResults = workspace:Raycast(origin, (destination - origin) * distance, RayCastParams)

	if RayCastResults then
		return RayCastResults
	end
end

return Combat
