So I made a gun where If you equip It and click on a Player or a NPC It will Instantly kill them, however It appears there was a error In the output the error says "Unable to cast values to Objects", here Is the script:

tool.Fire.OnServerEvent:Connect(function(player,mousePos)
	Pew:Play() ---This just plays a sound btw
	
	local raycastParams = RaycastParams:new()
	raycastParams.FilterDescendantsInstances = (player.Character)
	raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
	
	local raycastResult = workspace:Raycast(script.Parent.Pistol.Position,(mousePos - script.Parent.Pistol.Position)*1000,raycastParams)
	
	if raycastResult then
		local HitPart = raycastResult.Instance
		local model = HitPart:FindFirstAncestorOfClass("Model")
		
		if model then
			if model:FindFirstChild("Humanoid") then
				model.Humanoid.Health -= 100
			end
		end
	end
	
	
end)